package com.maori.languageapp.curate.idiom;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.json.JSONArray;
import org.json.JSONObject;
import com.maori.languageapp.LanguageAppCaptureActivity;
import com.maori.languageapp.LanguageAppCaptureModify;
import com.maori.languageapp.Maori_MainActivity;
import com.maori.languageapp.R;
import com.maori.languageapp.UploadToFtp;
import com.maori.languageapp.UploadToFtpAudio;
import com.maori.languageapp.UploadToFtpVideo;
import com.maori.languageapp.adapter.Language_App_List_Exapander;
import com.maori.languageapp.adapter.Languageapp_Curate_AudioView_Activity;
import com.maori.languageapp.adapter.Languageapp_Curate_VideoView_Activity;
import com.maori.languageapp.consts.CaptureFilterAdapter;
import com.maori.languageapp.consts.ImageLoader;
import com.maori.languageapp.consts.UrlContant;
import com.maori.languageapp.curate.word.Maori_Curate_Word_Details;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaRecorder;
import android.media.MediaPlayer.OnCompletionListener;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.FilterQueryProvider;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.VideoView;
import android.widget.AdapterView.OnItemClickListener;

public class Maori_Curate_Idiom_Details extends Activity {
	// Database Name
	private static final String DATABASE_NAME = "maorilanguageapp.db";
	private String BOOKMARK_TABLE = "Bookmark";
	protected static final String TAG = null;
	String word, maori, nid, Source;
	private CaptureFilterAdapter dbHelper;
	private MediaPlayer mediaPlayer;
	private SimpleCursorAdapter dataAdapter;
	int TotalsNodeLikesVal;
	String UserLikedForNode, UserNodeBookMarked, MainNodeUID, TotalsNodeLikes;
	ProgressDialog mProgressDialog;
	Bitmap bmImg = null;
	Bitmap userbmImg = null;
	InputStream is = null;
	StringBuilder sb = null;
	int recordPlayVideo = 0;
	String result;
	JSONArray jArray;
	int NodeAudioPlay = 0;
	HttpParams httpParameters = new BasicHttpParams();
	String LastDownloadUpdateTime;
	TextView txtHeading;
	int timeoutConnection = 5000;
	JSONArray jsonarray;
	SQLiteDatabase mydb;
	ListView listview;
	private Bitmap bitmap;
	int HeaderBtnTag = 0;
	int ChangeAction = 0;
	int TotalsSynonimValue = 0, TotalsSynonimImagesValue = 0,
			TotalsSynonimVideoValue = 0;
	RadioGroup rgOpinion;
	// Adapter Objects
	Maori_Curate_Idiom_Details_Adapter adapter;
	Maori_Curate_AudioList_Idiom_Adapter adapterAudio;
	Maori_Curate_ImageList_Idiom_Adapter adapterImages;
	Maori_Curate_VideoList_Idiom_Adapter adapterVideos;

	private static String Description_a = "Description_a";
	private static String Description_b = "Description_b";
	private static String UIDuser = "UIDuser";
	private static String first_name = "first_name";
	private static String last_name = "last_name";
	private static String tribe = "tribe";
	private static String userimage = "MID";
	private static String UID = "UID";
	private static String NID = "nid";
	private static String MID = "MID";
	private static String M_Source = "M_Source";
	private static String SYNNID = "SYNNID";

	private static String first_namesuser = "first_namesuser";
	private static String last_nameuser = "last_nameuser";
	private static String userimageuser = "userimageuser";

	private static String TotalsLikes = "TotalsLikes";
	private static String TotalsSynonim = "TotalsSynonim";
	private static String TotalImages = "TotalImages";
	private static String TotalAudios = "TotalAudios";
	private static String TotalVideos = "TotalVideos";

	private static String TotalsLikesSyn = "TotalsLikesSyn";
	private static String TotalsLikesImage = "TotalsLikesImage";

	private static String NodeDifImage = "NodeDifImage";
	private static String NodeDifAudio = "NodeDifAudio";
	private static String NodeDifVideo = "NodeDifVideo";

	private static String IMAGENM_ID = "IMAGENM_ID";
	private static String IMAGENID = "IMAGENID";
	private static String IMAGEMID = "IMAGEMID";
	private static String IMAGEUID = "IMAGEUID";
	private static String IMAGEM_Source = "IMAGEM_Source";
	private static String IMAGEfirst_name = "IMAGEfirst_name";
	private static String IMAGElast_name = "IMAGElast_name";
	private static String IMAGETotalsLikes = "IMAGETotalsLikes";
	private static String SYNtribe = "SYNtribe";
	private static String SYNrole = "SYNrole";
	private static String SYNcurrent_location = "SYNcurrent_location";
	private static String role = "role";
	private static String current_location = "current_location";
	private static String dialact = "dialact";
	private static String VideoSyndialact = "VideoSyndialact";
	private static String AudioSyndialact = "AudioSyndialact";
	private static String ImageSyndialact = "ImageSyndialact";
	// Read Synonim
	private static String SYNParentNID = "SYNParentNID";
	private static String SYNUserLikedSyn = "SYNUserLikedSyn";
	private static String SYNParentUID = "SYNParentUID";
	private static String SYNdialact = "SYNdialact";
	// Video Synonim Handling
	private static String UserLikedVideo = "UserLikedVideo";
	private static String VideoParentNID = "VideoParentNID";
	private static String VideoParentUID = "VideoParentUID";
	private static String TotalsSetDefaultVideo = "TotalsSetDefaultVideo";
	// Audio Synonim Handling
	private static String UserLikedAudio = "UserLikedAudio";
	private static String AudioParentNID = "AudioParentNID";
	private static String AudioParentUID = "AudioParentUID";
	private static String TotalsSetDefaultAudio = "TotalsSetDefaultAudio";
	// Image Synonim
	private static String UserLikedImage = "UserLikedImage";
	private static String ImageParentNID = "ImageParentNID";
	private static String ImageParentUID = "ImageParentUID";
	private static String TotalsSetDefaultImage = "TotalsSetDefaultImage";

	private static String TotalsSetDefault = "TotalsSetDefault";

	private static String MediaUID = "MediaUID";
	private static String NodeMediaType = "NodeMediaType";

	// ==================================================
	/***************** Curate Actions **************************/

	private static String UserCurateStateSynonim = "UserCurateStateSynonim";
	private static String NodeMediaCode = "NodeMediaCode";
	private static String UserCurateStateImage = "UserCurateStateImage";
	private static String UserCurateStateVideo = "UserCurateStateVideo";
	private static String UserCurateStateAudio = "UserCurateStateAudio";
	private static String NodeApprovalCountValSynonim = "NodeApprovalCountValSynonim";
	private static String NodeRejectedCountValSynonim = "NodeRejectedCountValSynonim";

	int AudioDownFlg = 0;
	int AprroveState = 0;
	// Save Image,Audio Video Paths
	private String MEDIA_FILE_URL = "MediaFileUrl";

	ArrayList<HashMap<String, String>> arraylist;
	ArrayList<HashMap<String, String>> audioArrayList;
	ArrayList<HashMap<String, String>> imagesArrayList;
	ArrayList<HashMap<String, String>> videoArrayList;

	// Tabs Option Display
	Button wordsynonyms, wordaudio, wordimages, wordvideo,
			video_gallery_button;
	Button submitbtnsynonim;
	Button btnbookmarknode, btnsharenode, btnlikenode, btnplaynode,
			audio_gallery_button;
	// Image capturing Handlers
	String filemanagerstring;
	String selectedImagePath;
	ImageView SynonymImages;
	Uri selectedImageUri;
	String filePath, currentVideoName, NodeRejectedCount, NodeApprovalCount,
			MainNodeUserCurateState;
	private String tempDir;
	VideoView videoPreview;
	private static final int CAMERA_CAPTURE_IMAGE_REQUEST_CODE = 100;
	private static final int CAMERA_CAPTURE_VIDEO_REQUEST_CODE = 200;
	public static final int MEDIA_TYPE_IMAGE = 1;
	public static final int MEDIA_TYPE_VIDEO = 2;
	private static final int SELECT_IMAGE = 1;
	private static final int SELECT_AUDIO = 2;
	private static final int SELECT_VIDEO = 3;
	String desDirectory = "http://langapp.testarea.co.nz:2082/lanappimage/";
	private static final String IMAGE_DIRECTORY_NAME = "lANGUAGEAPP";
	static String upladingFromPathGallery = "606";
	String upladingFromPathAudio = "/storage/emulated/0/";
	String upladingFromPathVideo = "/storage/emulated/0/Pictures/lANGUAGEAPP/";
	String selectedPath = "";
	private Uri fileUri;
	private static final int PICK_IMAGE = 1;
	ImageView btnviewsynonims;
	Button btnaddnewsynonim, btnsearchexcisting;
	Button capture_camera_button, capture_gallery_button, videorecord_button,
			cancelbtn;

	EditText etmaorisynonimword, etenglishsynonimword;
	LinearLayout capturesynonims, searchviewarea, captureActionControllers,
			capturesynonimsaudio, capturesynonimsimages, capturesynonimsvideo,
			camvideoparent;
	ListView listViewSynonyms, listViewExcistingSynonyms,
			listViewAudioSynonyms, listViewImageSynonyms,
			listViewVideoSynonyms;

	String saveSaveSynonimAUrl, UserID, currentImageName;

	/**** Selection Identifires ****/
	int SynonimTag = 0, AudioTag = 0, ImageTag = 0, VideoTag = 0;
	int reloadTAG;
	String reloadREFNO;
	// Discover Audio Uploading Option
	Button record_button, play_button, videorecordplay_button;
	int recordActive = 0;
	int recordPlay = 0;
	int loadCounter = 0;
	private String outputFile = null;
	// Media resource path
	String AudioMainPath;
	String currentAudioName = "2=AUDIO";
	private MediaRecorder myRecorder;
	private MediaPlayer myPlayer;
	static String upladingFromPath, sourceUrl;
	static String filename;
	String desDirectoryAudio = "http://langapp.mirzabros.com/lanappaudio/";
	String desDirectoryVideo = "http://langapp.mirzabros.com/lanappvideo/";
	String desDirectoryImage = "http://langapp.mirzabros.com/lanappimage/";

	EditText searchfiltertext;
	String LikeRefId;
	int LikeCategory = 0;
	String SelectedDialect = "1";
	int curateActiveMode = 0; 
	Button btn_approve, btn_reject, btn_modify, curate_state;

	public void btnBackAction(View view) {
		Intent intent = new Intent(getBaseContext(), Maori_Curate_Idiom.class);
		intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
		this.startActivity(intent);
		this.finish();
		overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
		return;
	}

	@Override
	public void onBackPressed() {
		Intent intent = new Intent(getBaseContext(), Maori_Curate_Idiom.class);
		intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
		this.startActivity(intent);
		this.finish();
		overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
		return;
	}

	@SuppressLint("NewApi")
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// Remove title bar
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.maori_curate_idiom_details);
		txtHeading = (TextView) findViewById(R.id.screenTitle);
		txtHeading.setText("Curate Idiom Details");
		dbHelper = new CaptureFilterAdapter(this);
		dbHelper.open();
		saveSaveSynonimAUrl = UrlContant.SaveSynonimIdiomUrl;
		// Layout objects for cature new synonims
		capturesynonims = (LinearLayout) findViewById(R.id.capturesynonims);
		// Display Search Area
		searchviewarea = (LinearLayout) findViewById(R.id.searchviewarea);
		// Display Synonyms
		listViewSynonyms = (ListView) findViewById(R.id.listViewSynonyms);
		listViewExcistingSynonyms = (ListView) findViewById(R.id.listViewExcistingSynonyms);
		// Display Audio Synonyms
		listViewAudioSynonyms = (ListView) findViewById(R.id.listViewAudioSynonyms);
		// Display Image Synonyms
		listViewImageSynonyms = (ListView) findViewById(R.id.listViewImageSynonyms);
		// Display Video Synonyms
		listViewVideoSynonyms = (ListView) findViewById(R.id.listViewVideoSynonyms);
		// add new audio options block
		capturesynonimsaudio = (LinearLayout) findViewById(R.id.capturesynonimsaudio);
		// add new image option block
		capturesynonimsimages = (LinearLayout) findViewById(R.id.capturesynonimsimages);
		// add new video option block
		capturesynonimsvideo = (LinearLayout) findViewById(R.id.capturesynonimsvideo);
		camvideoparent = (LinearLayout) findViewById(R.id.camvideoparent);
		// Capture Controlling Buttons
		captureActionControllers = (LinearLayout) findViewById(R.id.captureActionControllers);

		// Search Box Action
		searchfiltertext = (EditText) findViewById(R.id.searchfiltertext);
		// Bar action controllers
		wordsynonyms = (Button) findViewById(R.id.wordsynonyms);
		wordaudio = (Button) findViewById(R.id.wordaudio);
		wordimages = (Button) findViewById(R.id.wordimages);
		wordvideo = (Button) findViewById(R.id.wordvideo);

		// Header sub option handling Buttons click
		btnbookmarknode = (Button) findViewById(R.id.btnbookmarknode);
		btnsharenode = (Button) findViewById(R.id.btnsharenode);
		btnlikenode = (Button) findViewById(R.id.btnlikenode);
		btnplaynode = (Button) findViewById(R.id.btnplaynode);

		videorecord_button = (Button) findViewById(R.id.videorecord_button);
		capture_camera_button = (Button) findViewById(R.id.capture_camera_button);
		capture_gallery_button = (Button) findViewById(R.id.capture_gallery_button);
		audio_gallery_button = (Button) findViewById(R.id.audio_gallery_button);
		videorecordplay_button = (Button) findViewById(R.id.videorecordplay_button);
		video_gallery_button = (Button) findViewById(R.id.video_gallery_button);
		// Display Allocated Layout Frames
		btnsearchexcisting = (Button) findViewById(R.id.btnsearchexcisting);
		btnviewsynonims = (ImageView) findViewById(R.id.btnviewsynonims);
		btnaddnewsynonim = (Button) findViewById(R.id.btnaddnewsynonim);

		videoPreview = (VideoView) findViewById(R.id.videoview);
		// Uploading Data Inputs

		etmaorisynonimword = (EditText) findViewById(R.id.etmaoriidiom);
		etenglishsynonimword = (EditText) findViewById(R.id.etenglishidiom);

		// Server Uploading Handlers
		submitbtnsynonim = (Button) findViewById(R.id.submitbtnsynonim);

		SynonymImages = (ImageView) findViewById(R.id.synonymImageView);
		/********** Audio Configuring ***************/
		// Button View Controllers
		record_button = (Button) findViewById(R.id.record_button);
		play_button = (Button) findViewById(R.id.play_button);
		rgOpinion = (RadioGroup) findViewById(R.id.radiodialet);
		/****** Set as default with selected Option *********/
		wordsynonyms
				.setBackgroundResource(R.drawable.left_orange_round_button_background);
		btnviewsynonims.setImageResource(R.drawable.ic_comment_h);
		listViewSynonyms.setVisibility(LinearLayout.VISIBLE);
		SynonimTag = 202;
		/**************** Curate Layout Handling *******************/
		btn_approve = (Button) findViewById(R.id.btn_approve);
		btn_reject = (Button) findViewById(R.id.btn_reject);
		btn_modify = (Button) findViewById(R.id.btn_modify);
		curate_state = (Button) findViewById(R.id.curate_state);

		getCurrentUserDetails();
		// Cancel Current View and Exit
		btn_approve.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				final Dialog dialog=new Dialog(Maori_Curate_Idiom_Details.this);
				dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
				dialog.setContentView(R.layout.languageapp_curate_approve_form);
				
				Button rejectaccept=(Button)dialog.findViewById(R.id.rejectaccept);
				rejectaccept.setOnClickListener(new View.OnClickListener() {
					public void onClick(View view) {
						int NodeRejectedCountVal = Integer.parseInt(NodeRejectedCount); 
						int NodeApprovalCountVal = Integer.parseInt(NodeApprovalCount);
						if(curateActiveMode == 0) {
							NodeApprovalCountVal = NodeApprovalCountVal + 1;
						}
						else if(curateActiveMode == 2){
							NodeApprovalCountVal = NodeApprovalCountVal + 1;
							NodeRejectedCountVal = NodeRejectedCountVal - 1;
						}
						
						btn_approve.setEnabled(false);
						btn_approve.setText("Approve(" + NodeApprovalCountVal + ")");
						btn_approve.setTextColor(Color.parseColor("#07afdf"));
						btn_approve.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_default_active, 0, 0, 0);
						
						btn_reject.setText("Reject(" + NodeRejectedCountVal + ")");
						btn_reject.setEnabled(true);
						btn_reject.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_reject_inactive, 0, 0, 0);
						btn_reject.setTextColor(Color.parseColor("#626262"));
						btn_modify.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_modify_inactive, 0, 0, 0);
						btn_modify.setTextColor(Color.parseColor("#626262"));
						AprroveState = 1;
						new UploadApprovalInformation().execute();
						dialog.dismiss();
					}
				});
				
				Button rejectcancel=(Button)dialog.findViewById(R.id.rejectcancel);
				rejectcancel.setOnClickListener(new View.OnClickListener() {
					public void onClick(View view) {
						dialog.dismiss();
					}
				});
				dialog.show();
			}
		});
		btn_reject.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				final Dialog dialog=new Dialog(Maori_Curate_Idiom_Details.this);
				dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
				dialog.setContentView(R.layout.languageapp_curate_reject_form);
				Button rejectaccept=(Button)dialog.findViewById(R.id.rejectaccept);
				rejectaccept.setOnClickListener(new View.OnClickListener() {
					public void onClick(View view) {
						int NodeRejectedCountVal = Integer.parseInt(NodeRejectedCount); 
						int NodeApprovalCountVal = Integer.parseInt(NodeApprovalCount);
						if(curateActiveMode == 0) {
							NodeRejectedCountVal = NodeRejectedCountVal + 1;
						}
						else if(curateActiveMode == 1){
							NodeApprovalCountVal = NodeApprovalCountVal - 1;
							NodeRejectedCountVal = NodeRejectedCountVal + 1;
						}
						btn_reject.setEnabled(false);
						btn_reject.setText("Reject(" + NodeRejectedCountVal + ")");
						btn_reject.setTextColor(Color.parseColor("#07afdf"));
						
						btn_approve.setEnabled(true);
						btn_approve.setText("Approve(" + NodeApprovalCountVal + ")");
						btn_approve.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_default_inactive, 0, 0, 0);
						btn_approve.setTextColor(Color.parseColor("#626262"));
						btn_reject.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_reject_active, 0, 0, 0);
						btn_modify.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_modify_inactive, 0, 0, 0);
						btn_modify.setTextColor(Color.parseColor("#626262"));
						AprroveState = 2;
						new UploadApprovalInformation().execute();
						dialog.dismiss();
					}
				});
				
				Button rejectcancel=(Button)dialog.findViewById(R.id.rejectcancel);
				rejectcancel.setOnClickListener(new View.OnClickListener() {
					public void onClick(View view) {
						dialog.dismiss();
					}
				});
				dialog.show();
			}
		});
		
		
		btn_modify.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				Intent i = new Intent(getApplicationContext(),
						LanguageAppCaptureModify.class);
				i.putExtra("NCMID", MID);
				i.putExtra("node_category", MID);
				i.putExtra("type", "Word");
				i.putExtra("SEARCHKEY", nid + "/00/00/" + word + "/" +maori);
				i.putExtra("ACTIVE", "1");
				startActivity(i);
			}
		});
	
		
		
		cancelbtn = (Button) findViewById(R.id.cancelbtn);
		cancelbtn.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				displayCancelDialog();
			}
		});

		new loadSingleView().execute();

		// Header Sub Option Panel Button Click Event Handling

		/************* Button animation *************/
		final View vbookmark = findViewById(R.id.btnbookmarknode);
		final Animation anima = AnimationUtils.loadAnimation(this,
				R.anim.btnzoominout);
		final View vshare = findViewById(R.id.btnsharenode);
		final Animation animb = AnimationUtils.loadAnimation(this,
				R.anim.btnzoominout);
		final View vlike = findViewById(R.id.btnlikenode);
		final Animation animc = AnimationUtils.loadAnimation(this,
				R.anim.btnzoominout);
		final View vplay = findViewById(R.id.btnplaynode);
		final Animation animd = AnimationUtils.loadAnimation(this,
				R.anim.btnzoominout);

		btnbookmarknode.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				ChangeAction = 202;
				if (UserNodeBookMarked.equals("0")) {
					UserNodeBookMarked = "1";
					btnbookmarknode.setCompoundDrawablesWithIntrinsicBounds(0,
							R.drawable.ic_bookmark_hed, 0, 0);
				} else {
					UserNodeBookMarked = "0";
					btnbookmarknode.setCompoundDrawablesWithIntrinsicBounds(0,
							R.drawable.ic_bookmark_h, 0, 0);
				}
				HeaderBtnTag = 100;
				vbookmark.startAnimation(anima);
				new UploadBookMarkDetails().execute();
				saveBookMarkDetails();
			}
		});
		btnsharenode.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				HeaderBtnTag = 200;
				vshare.startAnimation(animb);
				Log.v("TAG", "Share:" + nid + "/" + UserID);
			}
		});
		btnlikenode.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				ChangeAction = 202;
				HeaderBtnTag = 300;
				if (UserLikedForNode.equals("0")) {
					UserLikedForNode = "1";
					TotalsNodeLikesVal = Integer.parseInt(TotalsNodeLikes);
					TotalsNodeLikesVal = TotalsNodeLikesVal + 1;
					TotalsNodeLikes = "" + TotalsNodeLikesVal;
					btnlikenode.setCompoundDrawablesWithIntrinsicBounds(0,
							R.drawable.ic_like_hed, 0, 0);
					btnlikenode.setText("Like(" + TotalsNodeLikes + ")");
				} else {
					UserLikedForNode = "0";
					TotalsNodeLikesVal = Integer.parseInt(TotalsNodeLikes);
					TotalsNodeLikesVal = TotalsNodeLikesVal - 1;
					TotalsNodeLikes = "" + TotalsNodeLikesVal;
					btnlikenode.setCompoundDrawablesWithIntrinsicBounds(0,
							R.drawable.ic_like_h, 0, 0);
					btnlikenode.setText("Like(" + TotalsNodeLikes + ")");
				}
				vlike.startAnimation(animc);
				new UploadBookMarkDetails().execute();
			}
		});
		btnplaynode.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				HeaderBtnTag = 400;
				vplay.startAnimation(animd);
				HeaderBtnTag = 400;
				vplay.startAnimation(animd);
				if (NodeAudioPlay == 0) {
					NodeAudioPlay = 1;
					btnplaynode.setCompoundDrawablesWithIntrinsicBounds(0,
							R.drawable.ic_pause_h, 0, 0);

					mediaPlayer = new MediaPlayer();
					mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
					try {
						mediaPlayer.setDataSource(NodeDifAudio);
						mediaPlayer.prepare();
					} catch (IllegalArgumentException e) {
						e.printStackTrace();
					} catch (SecurityException e) {
						e.printStackTrace();
					} catch (IllegalStateException e) {
						e.printStackTrace();
					} catch (IOException e) {
						e.printStackTrace();
					}

					mediaPlayer.start();
					Log.e("########", "Audio Recording Play Start...");
					// Audio Complete Identification
					mediaPlayer
							.setOnCompletionListener(new OnCompletionListener() {

								public void onCompletion(MediaPlayer mp) {
									mediaPlayer.pause();
									NodeAudioPlay = 0;
									btnplaynode
											.setCompoundDrawablesWithIntrinsicBounds(
													0, R.drawable.ic_play_h, 0,
													0);
									Log.e("########", "Audio Play Completed...");
								}
							});

				} else if (NodeAudioPlay == 1) {
					mediaPlayer.stop();
					mediaPlayer.release();
					NodeAudioPlay = 0;
					btnplaynode.setCompoundDrawablesWithIntrinsicBounds(0,
							R.drawable.ic_play_h, 0, 0);
				}

			}
		});

		/************** Data Display Filter Options **************/
		btnaddnewsynonim.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				// int SynonimTag = 0, AudioTag = 0, ImageTag = 0, VideoTag = 0;
				if (SynonimTag == 202) {
					/********* Make Related View Visible True *************/
					capturesynonims.setVisibility(LinearLayout.VISIBLE);
					captureActionControllers
							.setVisibility(LinearLayout.VISIBLE);
					capturesynonimsvideo.setVisibility(LinearLayout.GONE);
					camvideoparent.setVisibility(LinearLayout.GONE);
					searchviewarea.setVisibility(LinearLayout.GONE);
					listViewSynonyms.setVisibility(LinearLayout.GONE);
					listViewAudioSynonyms.setVisibility(LinearLayout.GONE);
					listViewImageSynonyms.setVisibility(LinearLayout.GONE);
					listViewVideoSynonyms.setVisibility(LinearLayout.GONE);
					/********* Make Other Views Visible Gone *************/
				} else if (AudioTag == 202) {
					capturesynonimsaudio.setVisibility(LinearLayout.VISIBLE);
					captureActionControllers
							.setVisibility(LinearLayout.VISIBLE);
					capturesynonimsvideo.setVisibility(LinearLayout.GONE);
					camvideoparent.setVisibility(LinearLayout.GONE);
					searchviewarea.setVisibility(LinearLayout.GONE);
					listViewAudioSynonyms.setVisibility(LinearLayout.GONE);
					listViewSynonyms.setVisibility(LinearLayout.GONE);
					listViewImageSynonyms.setVisibility(LinearLayout.GONE);
					listViewVideoSynonyms.setVisibility(LinearLayout.GONE);
				} else if (ImageTag == 202) {
					capturesynonimsimages.setVisibility(LinearLayout.VISIBLE);
					captureActionControllers
							.setVisibility(LinearLayout.VISIBLE);

					capturesynonimsvideo.setVisibility(LinearLayout.GONE);
					camvideoparent.setVisibility(LinearLayout.GONE);
					capturesynonimsaudio.setVisibility(LinearLayout.GONE);
					searchviewarea.setVisibility(LinearLayout.GONE);
					listViewAudioSynonyms.setVisibility(LinearLayout.GONE);
					listViewSynonyms.setVisibility(LinearLayout.GONE);
					listViewImageSynonyms.setVisibility(LinearLayout.GONE);
					listViewVideoSynonyms.setVisibility(LinearLayout.GONE);
				} else if (VideoTag == 202) {
					capturesynonimsvideo.setVisibility(LinearLayout.VISIBLE);
					camvideoparent.setVisibility(LinearLayout.VISIBLE);
					captureActionControllers
							.setVisibility(LinearLayout.VISIBLE);

					capturesynonimsaudio.setVisibility(LinearLayout.GONE);
					searchviewarea.setVisibility(LinearLayout.GONE);
					listViewAudioSynonyms.setVisibility(LinearLayout.GONE);
					listViewSynonyms.setVisibility(LinearLayout.GONE);
					listViewImageSynonyms.setVisibility(LinearLayout.GONE);
					listViewVideoSynonyms.setVisibility(LinearLayout.GONE);
				}
			}
		});

		btnviewsynonims.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				if (SynonimTag == 202) {
					/********* Make Related View Visible True *************/
					listViewSynonyms.setVisibility(LinearLayout.VISIBLE);

					/********* Make Other Views Visible Gone *************/
					listViewAudioSynonyms.setVisibility(LinearLayout.GONE);
					listViewImageSynonyms.setVisibility(LinearLayout.GONE);
					capturesynonims.setVisibility(LinearLayout.GONE);
					captureActionControllers.setVisibility(LinearLayout.GONE);
					searchviewarea.setVisibility(LinearLayout.GONE);
				}

				else if (AudioTag == 202) {
					/********* Make Related View Visible True *************/
					listViewAudioSynonyms.setVisibility(LinearLayout.VISIBLE);

					/********* Make Other Views Visible Gone *************/
					listViewSynonyms.setVisibility(LinearLayout.GONE);
					listViewImageSynonyms.setVisibility(LinearLayout.GONE);
					capturesynonims.setVisibility(LinearLayout.GONE);
					captureActionControllers.setVisibility(LinearLayout.GONE);
					searchviewarea.setVisibility(LinearLayout.GONE);
				}

				else if (ImageTag == 202) {
					/********* Make Related View Visible True *************/
					listViewImageSynonyms.setVisibility(LinearLayout.VISIBLE);

					/********* Make Other Views Visible Gone *************/
					listViewAudioSynonyms.setVisibility(LinearLayout.GONE);
					listViewSynonyms.setVisibility(LinearLayout.GONE);
					capturesynonims.setVisibility(LinearLayout.GONE);
					captureActionControllers.setVisibility(LinearLayout.GONE);
					searchviewarea.setVisibility(LinearLayout.GONE);
				}

				else if (VideoTag == 202) {
					/********* Make Related View Visible True *************/

					/********* Make Other Views Visible Gone *************/
					listViewImageSynonyms.setVisibility(LinearLayout.GONE);
					listViewAudioSynonyms.setVisibility(LinearLayout.GONE);
					capturesynonims.setVisibility(LinearLayout.GONE);
					captureActionControllers.setVisibility(LinearLayout.GONE);
					searchviewarea.setVisibility(LinearLayout.GONE);
				}
			}
		});
		btnsearchexcisting.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				if (SynonimTag == 202) {
					loadWordsDetailsList();
					capturesynonims.setVisibility(LinearLayout.GONE);
					captureActionControllers.setVisibility(LinearLayout.GONE);
					searchviewarea.setVisibility(LinearLayout.VISIBLE);
					listViewExcistingSynonyms
							.setVisibility(LinearLayout.VISIBLE);
					listViewSynonyms.setVisibility(LinearLayout.GONE);
					listViewAudioSynonyms.setVisibility(LinearLayout.GONE);
				} else if (AudioTag == 202) {
					capturesynonims.setVisibility(LinearLayout.GONE);
					captureActionControllers.setVisibility(LinearLayout.GONE);
					searchviewarea.setVisibility(LinearLayout.VISIBLE);
					listViewAudioSynonyms.setVisibility(LinearLayout.VISIBLE);
					listViewSynonyms.setVisibility(LinearLayout.GONE);
					listViewExcistingSynonyms.setVisibility(LinearLayout.GONE);
				} else if (ImageTag == 202) {

				} else if (VideoTag == 202) {

				}
			}
		});

		/******* Upload Word Synonyms ******/
		submitbtnsynonim.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				RadioButton selectRadio = (RadioButton) findViewById(rgOpinion
						.getCheckedRadioButtonId());
				String SelectedOption = selectRadio.getText().toString();
				if (SelectedOption.equals("North Island")) {
					SelectedDialect = "1";
				} else if (SelectedOption.equals("South Island")) {
					SelectedDialect = "2";
				}
				if (VideoTag == 202) {
					if (isNetworkAvailable()) {
						new UploadVideoDetails().execute();

					} else {

					}
				}
				if (AudioTag == 202) {
					if (isNetworkAvailable()) {
						new UploadAudioDetails().execute();

					} else {

					}
				}
				if (ImageTag == 202) {
					if (isNetworkAvailable()) {
						new UploadImageDetails().execute();

					} else {

					}

				}
				if (SynonimTag == 202) {
					new UploadingSynonimDetails().execute();
				}

			}
		});

		/*********** Tabs Options Handlers ***********/
		wordsynonyms.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				SynonimTag = 202;
				AudioTag = 0;
				ImageTag = 0;
				VideoTag = 0;

				// btnsearchexcisting.setImageResource(R.drawable.ic_search_h);
				btnviewsynonims.setImageResource(R.drawable.ic_comment_h);

				wordsynonyms
						.setBackgroundResource(R.drawable.left_orange_round_button_background);
				wordaudio
						.setBackgroundResource(R.drawable.left_squire_button_background);
				wordimages
						.setBackgroundResource(R.drawable.left_squire_button_background);
				wordvideo
						.setBackgroundResource(R.drawable.right_round_button_background);
				/********** Display Panels **********************/
				btnsearchexcisting.setVisibility(ImageView.VISIBLE);
				listViewImageSynonyms.setVisibility(LinearLayout.GONE);
				capturesynonimsimages.setVisibility(LinearLayout.GONE);
				listViewVideoSynonyms.setVisibility(LinearLayout.GONE);
				capturesynonims.setVisibility(LinearLayout.GONE);
				listViewSynonyms.setVisibility(LinearLayout.VISIBLE);
				listViewExcistingSynonyms.setVisibility(LinearLayout.GONE);
				searchviewarea.setVisibility(LinearLayout.GONE);
				listViewAudioSynonyms.setVisibility(LinearLayout.GONE);
				capturesynonimsaudio.setVisibility(LinearLayout.GONE);
				capturesynonimsvideo.setVisibility(LinearLayout.GONE);
				camvideoparent.setVisibility(LinearLayout.GONE);
				/********** Hide Panels **********************/

			}
		});
		wordaudio.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				SynonimTag = 0;
				AudioTag = 202;
				ImageTag = 0;
				VideoTag = 0;

				btnviewsynonims.setImageResource(R.drawable.ic_record_h);

				wordsynonyms
						.setBackgroundResource(R.drawable.left_round_button_background);
				wordaudio
						.setBackgroundResource(R.drawable.left_orange_squire_button_background);
				wordimages
						.setBackgroundResource(R.drawable.left_squire_button_background);
				wordvideo
						.setBackgroundResource(R.drawable.right_round_button_background);

				/********** Display Panels **********************/
				listViewAudioSynonyms.setVisibility(LinearLayout.VISIBLE);
				capturesynonimsaudio.setVisibility(LinearLayout.GONE);
				/********** Hide Panels **********************/
				btnsearchexcisting.setVisibility(ImageView.GONE);
				listViewImageSynonyms.setVisibility(LinearLayout.GONE);
				capturesynonimsimages.setVisibility(LinearLayout.GONE);
				captureActionControllers.setVisibility(LinearLayout.GONE);
				capturesynonims.setVisibility(LinearLayout.GONE);
				searchviewarea.setVisibility(LinearLayout.GONE);
				listViewSynonyms.setVisibility(LinearLayout.GONE);
				listViewExcistingSynonyms.setVisibility(LinearLayout.GONE);
				listViewVideoSynonyms.setVisibility(LinearLayout.GONE);
				capturesynonimsvideo.setVisibility(LinearLayout.GONE);
				camvideoparent.setVisibility(LinearLayout.GONE);
			}
		});

		wordimages.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				SynonimTag = 0;
				AudioTag = 0;
				ImageTag = 202;
				VideoTag = 0;

				btnviewsynonims.setImageResource(R.drawable.ic_camera_h);

				wordsynonyms
						.setBackgroundResource(R.drawable.left_round_button_background);
				wordaudio
						.setBackgroundResource(R.drawable.left_squire_button_background);
				wordimages
						.setBackgroundResource(R.drawable.left_orange_squire_button_background);
				wordvideo
						.setBackgroundResource(R.drawable.right_round_button_background);

				/********** Display Panels **********************/

				/********** Hide Panels **********************/
				btnsearchexcisting.setVisibility(ImageView.GONE);
				capturesynonimsimages.setVisibility(LinearLayout.GONE);
				listViewImageSynonyms.setVisibility(LinearLayout.VISIBLE);
				captureActionControllers.setVisibility(LinearLayout.GONE);
				capturesynonims.setVisibility(LinearLayout.GONE);
				searchviewarea.setVisibility(LinearLayout.GONE);
				listViewVideoSynonyms.setVisibility(LinearLayout.GONE);
				listViewSynonyms.setVisibility(LinearLayout.GONE);
				listViewAudioSynonyms.setVisibility(LinearLayout.GONE);
				capturesynonimsaudio.setVisibility(LinearLayout.GONE);
				listViewExcistingSynonyms.setVisibility(LinearLayout.GONE);
				capturesynonimsvideo.setVisibility(LinearLayout.GONE);
				camvideoparent.setVisibility(LinearLayout.GONE);
			}
		});

		wordvideo.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				SynonimTag = 0;
				AudioTag = 0;
				ImageTag = 0;
				VideoTag = 202;

				btnviewsynonims.setImageResource(R.drawable.ic_video_h);

				wordsynonyms
						.setBackgroundResource(R.drawable.left_round_button_background);
				wordaudio
						.setBackgroundResource(R.drawable.left_squire_button_background);
				wordimages
						.setBackgroundResource(R.drawable.left_squire_button_background);
				wordvideo
						.setBackgroundResource(R.drawable.right_orange_round_button_background);

				/********** Display Panels **********************/

				/********** Hide Panels **********************/
				btnsearchexcisting.setVisibility(ImageView.GONE);
				capturesynonimsimages.setVisibility(LinearLayout.GONE);
				listViewVideoSynonyms.setVisibility(LinearLayout.VISIBLE);
				listViewImageSynonyms.setVisibility(LinearLayout.GONE);
				captureActionControllers.setVisibility(LinearLayout.GONE);
				capturesynonims.setVisibility(LinearLayout.GONE);
				searchviewarea.setVisibility(LinearLayout.GONE);
				listViewSynonyms.setVisibility(LinearLayout.GONE);
				listViewAudioSynonyms.setVisibility(LinearLayout.GONE);
				capturesynonimsaudio.setVisibility(LinearLayout.GONE);
				listViewExcistingSynonyms.setVisibility(LinearLayout.GONE);
				capturesynonimsvideo.setVisibility(LinearLayout.GONE);
				camvideoparent.setVisibility(LinearLayout.GONE);
			}
		});

		/*************** AUDIO RECORDING ACTION ***********************/
		record_button.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				if (recordActive == 0) {
					recordActive = 1;
					// Audio Recording
					// store it to sd card
					record_button.setCompoundDrawablesWithIntrinsicBounds(0,
							R.drawable.ic_audiostoprecord, 0, 0);
					outputFile = Environment.getExternalStorageDirectory()
							.getAbsolutePath()
							+ "/"
							+ getAudiorecording().toString() + ".mp4";
					AudioMainPath = Environment.getExternalStorageDirectory()
							.getAbsolutePath() + "/";
					currentAudioName = getAudiorecording().toString() + ".mp4";
					myRecorder = new MediaRecorder();
					myRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
					myRecorder
							.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
					myRecorder
							.setAudioEncoder(MediaRecorder.OutputFormat.AMR_NB);
					myRecorder.setOutputFile(outputFile);
					Log.v(TAG, "AUDIO PATH : " + currentAudioName);
					saveMediaFileDetails();
					play_button.setEnabled(false);
					start(view);
				} else if (recordActive == 1) {
					recordActive = 0;
					record_button.setCompoundDrawablesWithIntrinsicBounds(0,
							R.drawable.ic_audiorecord, 0, 0);
					play_button.setEnabled(true);
					stop(view);
				}
			}
		});

		/*************** REPLAY AUDIO RECORDING ACTION ***********************/
		play_button.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				if (recordPlay == 0) {
					recordPlay = 1;
					play_button.setCompoundDrawablesWithIntrinsicBounds(0,
							R.drawable.ic_pausemedia, 0, 0);
					record_button.setEnabled(false);
					recordPlay(view);
				} else if (recordPlay == 1) {
					recordPlay = 0;
					play_button.setCompoundDrawablesWithIntrinsicBounds(0,
							R.drawable.ic_playmedia, 0, 0);
					record_button.setEnabled(true);
					stopPlay(view);
				}

			}
		});

		/*************** SELECT AUDIO FROM GALLERY ***********************/
		audio_gallery_button.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				try {
					Intent intent = new Intent();
					intent.setType("audio/*");
					intent.setAction(Intent.ACTION_GET_CONTENT);
					startActivityForResult(
							Intent.createChooser(intent, "Select Audio "),
							SELECT_AUDIO);

				} catch (Exception e) {
					Toast.makeText(getApplicationContext(), e.getMessage(),
							Toast.LENGTH_LONG).show();
					Log.e(e.getClass().getName(), e.getMessage(), e);
				}
			}
		});

		/************** CAMERA CAPTURE ACTION ***********************/
		capture_camera_button.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				// create intent with ACTION_IMAGE_CAPTURE action
				Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
				intent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION,
						ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
				fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);

				// Log.v(TAG, "PRINT _ 1: " + fileUri);
				intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
				// start the image capture Intent
				startActivityForResult(intent,
						CAMERA_CAPTURE_IMAGE_REQUEST_CODE);
			}
		});

		/************** SELECT CAPTURE ACTION ***********************/
		capture_gallery_button.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				try {
					Intent intent = new Intent();
					intent.setType("image/*");
					intent.setAction(Intent.ACTION_GET_CONTENT);
					startActivityForResult(
							Intent.createChooser(intent, "Select Picture"),
							PICK_IMAGE);

				} catch (Exception e) {
					Toast.makeText(getApplicationContext(), e.getMessage(),
							Toast.LENGTH_LONG).show();
					Log.e(e.getClass().getName(), e.getMessage(), e);
				}
			}
		});

		/************* VIDEO RECORD ACTION ************************/
		videorecord_button.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
				intent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION,
						ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
				fileUri = getOutputMediaFileUri(MEDIA_TYPE_VIDEO);
				String URIPATH = fileUri.toString();
				String[] separated = URIPATH.split("/");
				currentVideoName = separated[8];
				Log.v(TAG, "VIDEO PRINT URI : " + currentVideoName);
				// file:///storage/emulated/0/Pictures/lANGUAGEAPP/VID_20140421_133732.mp4
				// set video quality
				intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);

				intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the
																	// image
																	// file
																	// name
				openPath(fileUri);

				videoPreview.setVisibility(View.VISIBLE);
				// start the video capture Intent
				startActivityForResult(intent,
						CAMERA_CAPTURE_VIDEO_REQUEST_CODE);
			}
		});

		/************* VIDEO RECORD REPLAY ACTION ************************/
		// Play Current Video Recoring
		videorecordplay_button.setOnClickListener(new View.OnClickListener() {
			public void onClick(final View view) {
				camvideoparent.setVisibility(View.VISIBLE);
				if (fileUri == null) {
					Toast.makeText(Maori_Curate_Idiom_Details.this, "No Video",
							Toast.LENGTH_LONG).show();
				} else {
					if (recordPlayVideo == 0) {
						recordPlayVideo = 1;
						videorecordplay_button
								.setCompoundDrawablesWithIntrinsicBounds(0,
										R.drawable.ic_pausemedia, 0, 0);
						videorecord_button.setEnabled(false);
						videoPreview.setVideoURI(fileUri);
						videoPreview.start();
					} else if (recordPlayVideo == 1) {
						recordPlayVideo = 0;
						videorecordplay_button
								.setCompoundDrawablesWithIntrinsicBounds(0,
										R.drawable.ic_playmedia, 0, 0);
						videorecord_button.setEnabled(true);
						stopPlayVideo(view);
					}
					videoPreview
							.setOnCompletionListener(new OnCompletionListener() {

								public void onCompletion(MediaPlayer mp) {
									stopPlayVideo(view);
									recordPlayVideo = 0;
									videorecordplay_button
											.setCompoundDrawablesWithIntrinsicBounds(
													0, R.drawable.ic_playmedia,
													0, 0);
									videorecord_button.setEnabled(true);
									Log.e("########", "Video Play Completed...");
								}
							});
				}
			}
		});

		/************* SELECT VIDEO FROM GALLERY ACTION ************************/
		video_gallery_button.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				try {

					Intent intent = new Intent();
					intent.setType("video/*");
					intent.setAction(Intent.ACTION_GET_CONTENT);
					startActivityForResult(
							Intent.createChooser(intent, "Select Video "),
							SELECT_VIDEO);

				} catch (Exception e) {
					Toast.makeText(getApplicationContext(), e.getMessage(),
							Toast.LENGTH_LONG).show();
					Log.e(e.getClass().getName(), e.getMessage(), e);
				}

			}
		});

		Intent i = getIntent();
		nid = i.getStringExtra("nid");

	}

	protected void stopPlayVideo(View view) {
		// TODO Auto-generated method stub
		videoPreview.pause();
	}

	protected void saveBookMarkDetails() {
		// TODO Auto-generated method stub
		mydb = openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, null);
		ContentValues saveBookMark = new ContentValues();
		Cursor checkFlag = null;
		try {
			checkFlag = mydb.query(BOOKMARK_TABLE, null, "NID = '" + nid + "'",
					null, null, null, null);
		} catch (Exception e) {
		}
		if (checkFlag != null) {
			if (checkFlag.getCount() >= 1) {
				Log.v(TAG, "Excisting Book Mark :" + nid);
			} else {
				try {
					saveBookMark.put("NID", nid);
					saveBookMark.put("english_title", word);
					saveBookMark.put("english_det", word);
					saveBookMark.put("maori_title", maori);
					saveBookMark.put("maori_det", maori);
					saveBookMark.put("category", "word");
					mydb.insert(BOOKMARK_TABLE, null, saveBookMark);
				} catch (Exception e) {

				}
			}
		}
	}

	protected void displayCancelDialog() {
		// TODO Auto-generated method stub
		AlertDialog.Builder builder = new AlertDialog.Builder(
				Maori_Curate_Idiom_Details.this);
		builder.setTitle("CANCEL");
		builder.setMessage("Are Sure You Want To Exit...");
		builder.setPositiveButton("YES", new DialogInterface.OnClickListener() {
			@Override
			public void onClick(DialogInterface arg0, int arg1) {
				// TODO Auto-generated method stub
				Intent myIntent = new Intent(getBaseContext(),
						Maori_MainActivity.class);
				myIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
						| Intent.FLAG_ACTIVITY_NEW_TASK);
				startActivityForResult(myIntent, 0);
			}
		});
		builder.setNegativeButton("NO", new DialogInterface.OnClickListener() {
			@Override
			public void onClick(DialogInterface arg0, int arg1) {
				// TODO Auto-generated method stub
				Toast.makeText(getApplicationContext(),
						"Add New Words Details..", Toast.LENGTH_LONG).show();
			}
		});
		builder.show();
	}

	protected void loadWordsDetailsList() {
		// TODO Auto-generated method stub
		try {
			// TODO Auto-generated method stub
			Cursor cursor = dbHelper.fetchAllIdiomItems();
			// The desired columns to be bound
			String[] columns = new String[] { CaptureFilterAdapter.KEY_Idiom,
					CaptureFilterAdapter.KEY_Otheridioms };
			String[] fromtrdes = new String[] { "coldes_1", "coldes_2" };
			// the XML defined views which the data will be bound to
			int[] to = new int[] { R.id.discover_maori_title,
					R.id.discover_english_title };
			// create the adapter using the cursor pointing to the desired data
			// as well as the layout information
			dataAdapter = new SimpleCursorAdapter(this,
					R.layout.language_capture_filter_list_raw, cursor, columns,
					to, 0);

			ListView listViewSearch = (ListView) findViewById(R.id.listViewExcistingSynonyms);
			// Assign adapter to ListView
			listViewSearch.setAdapter(dataAdapter);

			listViewSearch.setOnItemClickListener(new OnItemClickListener() {
				@Override
				public void onItemClick(AdapterView<?> listView, View view,
						int position, long id) {
					// Get the cursor, positioned to the corresponding row in
					// the
					// result set
					Cursor cursor = (Cursor) listView
							.getItemAtPosition(position);

					// Get the state's capital from this row in the database.
					String countryCode = cursor.getString(cursor
							.getColumnIndexOrThrow("word"));
					Toast.makeText(getApplicationContext(), countryCode,
							Toast.LENGTH_SHORT).show();

				}
			});
			Language_App_List_Exapander.getListViewSize(listViewSearch);
			searchfiltertext.addTextChangedListener(new TextWatcher() {

				public void afterTextChanged(Editable s) {
				}

				public void beforeTextChanged(CharSequence s, int start,
						int count, int after) {
				}

				public void onTextChanged(CharSequence s, int start,
						int before, int count) {
					dataAdapter.getFilter().filter(s.toString());
				}
			});

			dataAdapter.setFilterQueryProvider(new FilterQueryProvider() {
				public Cursor runQuery(CharSequence constraint) {
					return dbHelper.fetchItemsByName(constraint.toString());
				}
			});
		} catch (Exception e) {
			Log.v(TAG, "Exception*****:" + e);
		}

	}

	/***************** Image capture option handlers **************************/
	/*
	 * Creating file uri to store image/video
	 */
	public Uri getOutputMediaFileUri(int type) {
		return Uri.fromFile(getOutputMediaFile(type));
	}

	/*
	 * returning image / video
	 */
	private static File getOutputMediaFile(int type) {

		// External sdcard location
		File mediaStorageDir = new File(
				Environment
						.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES),
				IMAGE_DIRECTORY_NAME);
		Log.v(TAG, "PRINT _ 4: " + mediaStorageDir);
		upladingFromPath = mediaStorageDir.getAbsolutePath();
		// Create the storage directory if it does not exist
		if (!mediaStorageDir.exists()) {
			if (!mediaStorageDir.mkdirs()) {
				Log.d(IMAGE_DIRECTORY_NAME, "Oops! Failed create "
						+ IMAGE_DIRECTORY_NAME + " directory");
				return null;
			}
		}

		// Create a media file name
		String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss",
				Locale.getDefault()).format(new Date());
		File mediaFile;
		if (type == MEDIA_TYPE_IMAGE) {
			mediaFile = new File(mediaStorageDir.getPath() + File.separator
					+ "IMG_" + timeStamp + ".jpg");
			filename = "IMG_" + timeStamp + ".jpg";
			sourceUrl = mediaFile.toString();
			Log.v(TAG, "PRINT _ 5: " + filename);
			Log.v(TAG, "PRINT _ 6: " + sourceUrl);

		} else if (type == MEDIA_TYPE_VIDEO) {
			mediaFile = new File(mediaStorageDir.getPath() + File.separator
					+ "VID_" + timeStamp + ".mp4");
			Log.v(TAG, "PRINT _ 7: " + mediaFile);
		} else {
			return null;
		}

		return mediaFile;
	}

	/*
	 * Display image from a path to ImageView
	 */
	private void previewCapturedImage() {
		try {
			// hide video preview
			// videoPreview.setVisibility(View.GONE);

			SynonymImages.setVisibility(View.VISIBLE);

			// bimatp factory
			BitmapFactory.Options options = new BitmapFactory.Options();

			// downsizing image as it throws OutOfMemory Exception for larger
			// images
			options.inSampleSize = 8;

			final Bitmap bitmap = BitmapFactory.decodeFile(fileUri.getPath(),
					options);
			SynonymImages.setImageBitmap(bitmap);
			Log.v(TAG, "PRINT _ PREVIEW 1 : " + fileUri.getPath());

		} catch (NullPointerException e) {
			e.printStackTrace();
		}
	}

	/*********** Audio Start And Stop Handlers ********************/
	// Stop Playing Audio
	protected void stop(View view) {
		// TODO Auto-generated method stub
		try {
			myRecorder.stop();
			myRecorder.release();
			myRecorder = null;

		} catch (IllegalStateException e) {
			// it is called before start()
			e.printStackTrace();
		} catch (RuntimeException e) {
			// no valid audio/video data has been received
			e.printStackTrace();
		}
	}

	// Start Playing Audio
	protected void start(View view) {
		// TODO Auto-generated method stub
		try {
			myRecorder.prepare();
			myRecorder.start();

		} catch (IllegalStateException e) {
			// start:it is called before prepare()
			// prepare: it is called after start() or before setOutputFormat()
			e.printStackTrace();
		} catch (IOException e) {
			// prepare() fails
			e.printStackTrace();
		}
		/*
		 * startBtn.setEnabled(false); stopBtn.setEnabled(true);
		 */
	}

	/*********** REPLAY AUDIO RECORDING *******************/
	protected void recordPlay(final View view) {
		// TODO Auto-generated method stub
		try {
			myPlayer = new MediaPlayer();
			myPlayer.setDataSource(outputFile);
			myPlayer.prepare();
			myPlayer.start();
			Log.e("########", "Audio Recording Play Start...");
			// Audio Complete Identification
			myPlayer.setOnCompletionListener(new OnCompletionListener() {

				public void onCompletion(MediaPlayer mp) {
					stopPlay(view);
					recordPlay = 0;
					play_button.setCompoundDrawablesWithIntrinsicBounds(0,
							R.drawable.ic_playmedia, 0, 0);
					record_button.setEnabled(true);
					Log.e("########", "Audio Play Completed...");
				}
			});

		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	protected void stopPlay(View view) {
		// TODO Auto-generated method stub
		try {
			if (myPlayer != null) {
				myPlayer.stop();
				myPlayer.release();
				myPlayer = null;

			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	/****************** Save Audio Details *****************************/
	protected void saveMediaFileDetails() {
		// TODO Auto-generated method stub
		mydb = openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, null);
		ContentValues enterFileUrl = new ContentValues();
		// Check Previous Language
		Cursor enterFileUrlDetails = null;
		try {
			enterFileUrlDetails = mydb.query(MEDIA_FILE_URL, null,
					"UploadingState !='0'", null, null, null, null);
		} catch (Exception e) {
		}
		if (enterFileUrlDetails != null) {
			if (enterFileUrlDetails.getCount() >= 1) {
				Log.v(TAG, "Excisting Language");
			} else {
				enterFileUrl.put("McategoryId", currentAudioName);
				enterFileUrl.put("MediaFileName", currentAudioName);
				enterFileUrl.put("ResouceDeviceUrl", AudioMainPath);
				enterFileUrl.put("ResouceServerUrl", AudioMainPath);
				enterFileUrl.put("UploadingState", "0");

				mydb.insert(MEDIA_FILE_URL, null, enterFileUrl);
				enterFileUrlDetails.close();
				mydb.close();
			}
		}

	}

	private void getCurrentUserDetails() {
		// TODO Auto-generated method stub
		mydb = openOrCreateDatabase(DATABASE_NAME, Context.MODE_PRIVATE, null);
		Cursor curGetUserInfo = null;
		String queryGetUserInfo;
		try {
			queryGetUserInfo = "SELECT * FROM User Where Activate = '1'";
			curGetUserInfo = mydb.rawQuery(queryGetUserInfo, null);
			if (curGetUserInfo != null) {
				if (curGetUserInfo.getCount() > 0) {
					while (curGetUserInfo.moveToNext()) {
						UserID = curGetUserInfo.getString(11);
					}
				}
			}

		} catch (Exception e) {

		}
		mydb.close();
	}

	public class loadSingleViewSyn extends AsyncTask<String, String, String> {
		private final String TAG = null;

		@Override
		protected void onPreExecute() {
			super.onPreExecute();
			// Create a progressdialog
			mProgressDialog = new ProgressDialog(
					Maori_Curate_Idiom_Details.this);
			// Set progressdialog title
			// mProgressDialog.setTitle("Update Likes");
			// Set progressdialog message
			mProgressDialog.setMessage("Processing...");
			mProgressDialog.setIndeterminate(false);
			mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
			mProgressDialog.setCancelable(false);
			// Show progressdialog
			mProgressDialog.show();

		}

		@Override
		protected String doInBackground(String... args) {
			// TODO Auto-generated method stub
			ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
			try {
				HttpPost httppost = null;
				HttpConnectionParams.setConnectionTimeout(httpParameters,
						timeoutConnection);
				HttpClient httpclient = new DefaultHttpClient(httpParameters);
				httppost = new HttpPost(
						"http://langapp.mirzabros.com/maoriapi/saveNodeLike.php");
				JSONObject json = new JSONObject();

				String[] LikeRefIdArray = LikeRefId.split("/");
				String synNID = LikeRefIdArray[0]; // NID
				String synUID = LikeRefIdArray[1]; // NID
				// Selected Type ID / content_type_id
				json.put("record1", synNID);
				// Selected UID / added_by
				json.put("record2", synUID);
				// Like Media Category
				json.put("record3", "0");

				JSONArray postjson = new JSONArray();
				postjson.put(json);

				httppost.setHeader("json", json.toString());
				httppost.getParams().setParameter("jsonpost", postjson);
				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
				HttpResponse response = httpclient.execute(httppost);
				HttpEntity entity = response.getEntity();
				is = entity.getContent();
				if (is != null) {

					BufferedReader reader = new BufferedReader(
							new InputStreamReader(is, "iso-8859-1"), 8);
					sb = new StringBuilder();
					sb.append(reader.readLine() + "\n");
					String line = "0";

					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result = sb.toString();
					if (result != null) {

					}
				}

			} catch (Exception e) {
				Log.e("REQUEST :", "Exception LIKES*** :" + e);
			}
			return null;
		}

		@Override
		protected void onPostExecute(String args) {
			mProgressDialog.dismiss();
			new loadSingleView().execute();
		}
	}

	public class loadSingleViewSynImage extends
			AsyncTask<String, String, String> {
		private final String TAG = null;

		@Override
		protected void onPreExecute() {
			super.onPreExecute();
			// Create a progressdialog
			mProgressDialog = new ProgressDialog(
					Maori_Curate_Idiom_Details.this);
			// Set progressdialog title
			// mProgressDialog.setTitle("Update Likes");
			// Set progressdialog message
			mProgressDialog.setMessage("Processing...");
			mProgressDialog.setIndeterminate(false);
			mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
			mProgressDialog.setCancelable(false);
			// Show progressdialog
			mProgressDialog.show();

		}

		@Override
		protected String doInBackground(String... args) {
			// TODO Auto-generated method stub
			ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
			try {
				HttpPost httppost = null;
				HttpConnectionParams.setConnectionTimeout(httpParameters,
						timeoutConnection);
				HttpClient httpclient = new DefaultHttpClient(httpParameters);
				httppost = new HttpPost(
						"http://langapp.mirzabros.com/maoriapi/saveNodeLike.php");
				JSONObject json = new JSONObject();

				String[] LikeRefIdArray = LikeRefId.split("/");
				String synNID = LikeRefIdArray[0]; // NID
				String synUID = LikeRefIdArray[1]; // NID
				// Selected Type ID / content_type_id
				json.put("record1", synNID);
				// Selected UID / added_by
				json.put("record2", synUID);
				// Like Media Category
				json.put("record3", "1");

				JSONArray postjson = new JSONArray();
				postjson.put(json);

				httppost.setHeader("json", json.toString());
				httppost.getParams().setParameter("jsonpost", postjson);
				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
				HttpResponse response = httpclient.execute(httppost);
				HttpEntity entity = response.getEntity();
				is = entity.getContent();
				if (is != null) {

					BufferedReader reader = new BufferedReader(
							new InputStreamReader(is, "iso-8859-1"), 8);
					sb = new StringBuilder();
					sb.append(reader.readLine() + "\n");
					String line = "0";

					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result = sb.toString();
					if (result != null) {

					}
				}

			} catch (Exception e) {
				Log.e("REQUEST :", "Exception LIKES*** :" + e);
			}
			return null;
		}

		@Override
		protected void onPostExecute(String args) {
			mProgressDialog.dismiss();
			reloadTAG = 99;
			new loadSingleView().execute();
		}
	}

	public class loadSingleView extends AsyncTask<String, String, String> {

		private final String TAG = null;

		@Override
		protected void onPreExecute() {
			super.onPreExecute();
			// Create a progressdialog
			mProgressDialog = new ProgressDialog(
					Maori_Curate_Idiom_Details.this);
			// Set progressdialog title
			mProgressDialog.setTitle("Loading");
			// Set progressdialog message
			mProgressDialog.setMessage("Loading Details...");
			mProgressDialog.setIndeterminate(false);
			mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
			mProgressDialog.setCancelable(false);
			// Show progressdialog
			mProgressDialog.show();

		}

		@Override
		protected String doInBackground(String... args) {
			loadCounter = loadCounter + 1;
			Intent x = getIntent();
			nid = x.getStringExtra("nid");
			Log.e("REQUEST :", "NID **** =" + nid);

			// if(reloadTAG == 99){
			ArrayList<NameValuePair> nameValuePairsMainW = new ArrayList<NameValuePair>();
			try {
				HttpConnectionParams.setConnectionTimeout(httpParameters,
						timeoutConnection);
				HttpClient httpclient = new DefaultHttpClient(httpParameters);
				HttpPost httppost = new HttpPost(
						"http://langapp.mirzabros.com/maoriapi/curate/getNodeFilteredCurateIdiom.php");
				JSONObject json = new JSONObject();
				json.put("record1", nid);
				json.put("record2", UserID);
				JSONArray postjson = new JSONArray();
				postjson.put(json);

				httppost.setHeader("json", json.toString());
				httppost.getParams().setParameter("jsonpost", postjson);
				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairsMainW));
				HttpResponse response = httpclient.execute(httppost);
				HttpEntity entity = response.getEntity();
				is = entity.getContent();
				if (is != null) {

					BufferedReader reader = new BufferedReader(
							new InputStreamReader(is, "iso-8859-1"), 8);
					sb = new StringBuilder();
					sb.append(reader.readLine() + "\n");
					String line = "0";

					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result = sb.toString();
					if (result != null) {
						Log.e("REQUEST :", "RESULT***** =" + result);
						// arraylist = new ArrayList<HashMap<String, String>>();
						try {
							JSONObject jsonObj = new JSONObject(result);
							jsonarray = jsonObj.getJSONArray("posts");
							for (int i = 0; i < jsonarray.length(); i++) {
								JSONObject c = jsonarray.getJSONObject(i);
								// Get the result of rank
								word = c.getString("word");
								// Get the result of country
								maori = c.getString("wordb");
								// Get the result of population
								nid = c.getString("NID");
								// Get the result of flag
								Source = c.getString("M_Source");
								if (Source.equals("404")) {
									Source = "http://langapp.mirzabros.com/images/placeholder.png";
								}
								// Get word category
								MID = c.getString("MID");
								// Get first Name
								first_name = c.getString("first_name");
								// Get last Name
								last_name = c.getString("last_name");
								// Get country
								tribe = c.getString("tribe");
								// Get user image
								userimage = c.getString("userimage");
								if (userimage.equals("404")) {
									Source = "http://langapp.mirzabros.com/images/placeholder.png";
								}
								// Get Counter Details
								TotalsLikes = c.getString("TotalsLikes");
								TotalsSynonim = c.getString("TotalsSynonim");
								TotalImages = c.getString("TotalImages");
								TotalAudios = c.getString("TotalAudios");
								TotalVideos = c.getString("TotalVideos");
								NodeDifImage = c.getString("NodeDifImage");
								NodeDifAudio = c.getString("NodeDifAudio");
								NodeDifVideo = c.getString("NodeDifVideo");

								role = c.getString("role");
								current_location = c
										.getString("current_location");
								dialact = c.getString("dialact");
								UserLikedForNode = c
										.getString("UserLikedForNode");
								UserNodeBookMarked = c
										.getString("UserNodeBookMarked");

								MainNodeUID = c.getString("MainNodeUID");
								TotalsNodeLikes = c
										.getString("TotalsNodeLikes");

								// **********Node Curate Validations************
								MainNodeUserCurateState = c
										.getString("UserCurateState");
								NodeApprovalCount = c
										.getString("NodeApprovalCount");
								NodeRejectedCount = c
										.getString("NodeRejectedCount");
								
								Log.v(TAG, "*MainNodeUserCurateState****:" + MainNodeUserCurateState);
								Log.v(TAG, "*NodeApprovalCount****:" + MainNodeUserCurateState);
								Log.v(TAG, "*NodeRejectedCount****:" + MainNodeUserCurateState);

							}
						} catch (Exception e) {
							Log.v(TAG, "***** Exception *****:" + e);
						}

					}

				}

			} catch (Exception e) {

			}

			/******** Listing Words Synonyms *******************************/
			ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
			try {
				HttpConnectionParams.setConnectionTimeout(httpParameters,
						timeoutConnection);
				HttpClient httpclient = new DefaultHttpClient(httpParameters);
				HttpPost httppost = new HttpPost(
						"http://langapp.mirzabros.com/maoriapi/curate/getCurateCurrentIdiomSynonyms.php");
				JSONObject json = new JSONObject();
				json.put("record1", nid);
				json.put("record2", UserID);
				JSONArray postjson = new JSONArray();
				postjson.put(json);
				Log.e("REQUEST :", "request Word Synonim**** :" + postjson);
				httppost.setHeader("json", json.toString());
				httppost.getParams().setParameter("jsonpost", postjson);
				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
				HttpResponse response = httpclient.execute(httppost);
				HttpEntity entity = response.getEntity();
				is = entity.getContent();
				if (is != null) {

					BufferedReader reader = new BufferedReader(
							new InputStreamReader(is, "iso-8859-1"), 8);
					sb = new StringBuilder();
					sb.append(reader.readLine() + "\n");
					String line = "0";

					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result = sb.toString();
					if (result != null) {
						Log.e("REQUEST :", "Synonym Res DDD*****:" + result);
						arraylist = new ArrayList<HashMap<String, String>>();
						try {
							JSONObject jsonObj = new JSONObject(result);
							jsonarray = jsonObj.getJSONArray("posts");
							int cynonimval = 0;
							for (int i = 0; i < jsonarray.length(); i++) {
								JSONObject c = jsonarray.getJSONObject(i);
								HashMap<String, String> map = new HashMap<String, String>();
								TotalsSynonimValue = TotalsSynonimValue + 1;
								Log.e("REQUEST :", "cynonimval(C) ****:"
										+ cynonimval);
								map.put("Description_a",
										c.getString("Description_a"));
								map.put("Description_b",
										c.getString("Description_b"));
								map.put("first_namesuser",
										c.getString("first_namesuser"));
								map.put("last_nameuser",
										c.getString("last_nameuser"));
								// Sorce URL
								map.put("userimageuser",
										c.getString("userimageuser"));
								map.put("UIDuser", c.getString("UIDuser"));
								map.put("TotalsLikesSyn",
										c.getString("TotalsLikesSyn"));
								map.put("SYNNID", c.getString("SYNNID"));
								map.put("SYNrole", c.getString("SYNrole"));
								map.put("SYNtribe", c.getString("SYNtribe"));
								map.put("SYNcurrent_location",
										c.getString("SYNcurrent_location"));

								map.put("SYNParentNID",
										c.getString("SYNParentNID"));
								map.put("SYNUserLikedSyn",
										c.getString("SYNUserLikedSyn"));
								map.put("SYNParentUID",
										c.getString("SYNParentUID"));
								map.put("SYNdialact", c.getString("SYNdialact"));
								map.put("TotalsSetDefault",
										c.getString("TotalsSetDefault"));
								map.put("UserCurateStateSynonim",
										c.getString("UserCurateStateSynonim"));
								map.put("NodeMediaCode",
										c.getString("NodeMediaCode"));
								map.put("NodeApprovalCountValSynonim",
										c.getString("NodeApprovalCountValSynonim"));
								map.put("NodeRejectedCountValSynonim",
										c.getString("NodeRejectedCountValSynonim"));
								arraylist.add(map);
							}
						} catch (Exception e) {
							Log.v(TAG, "***** Exception *****:" + e);
						}

					}

				}

			} catch (Exception e) {

			}
			// http://langapp.mirzabros.com/maoriapi/getNodeAudioSynonyms.php
			// http://langapp.mirzabros.com/maoriapi/getNodeAudioSynonyms.php
			/******** Listing Video Synonyms *******************************/
			ArrayList<NameValuePair> nameValuePairsVideo = new ArrayList<NameValuePair>();
			try {
				HttpConnectionParams.setConnectionTimeout(httpParameters,
						timeoutConnection);
				HttpClient httpclient = new DefaultHttpClient(httpParameters);
				HttpPost httppost = new HttpPost(
						"http://langapp.mirzabros.com/maoriapi/curate/getNodeCurateVideoSynonyms.php");
				JSONObject json = new JSONObject();
				json.put("record1", nid);
				json.put("record2", UserID);
				json.put("record3", "1");// Media Type = Word(REF = 1)
				JSONArray postjson = new JSONArray();
				postjson.put(json);
				Log.e("REQUEST :", "request Video**** :" + postjson);
				httppost.setHeader("json", json.toString());
				httppost.getParams().setParameter("jsonpost", postjson);
				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairsVideo));
				HttpResponse response = httpclient.execute(httppost);
				HttpEntity entity = response.getEntity();
				is = entity.getContent();
				if (is != null) {

					BufferedReader reader = new BufferedReader(
							new InputStreamReader(is, "iso-8859-1"), 8);
					sb = new StringBuilder();
					sb.append(reader.readLine() + "\n");
					String line = "0";

					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result = sb.toString();
					if (result != null) {
						videoArrayList = new ArrayList<HashMap<String, String>>();
						try {
							JSONObject jsonObj = new JSONObject(result);
							jsonarray = jsonObj.getJSONArray("posts");
							for (int i = 0; i < jsonarray.length(); i++) {
								TotalsSynonimVideoValue = TotalsSynonimVideoValue + 1;

								JSONObject c = jsonarray.getJSONObject(i);
								HashMap<String, String> map = new HashMap<String, String>();
								map.put("IMAGENM_ID", c.getString("ImageID"));
								map.put("IMAGENID", c.getString("ImageNID"));
								map.put("IMAGEMID", c.getString("ImageMID"));
								map.put("IMAGEUID", c.getString("ImageUID"));
								map.put("IMAGEM_Source",
										c.getString("ImageM_Source"));
								map.put("IMAGEfirst_name",
										c.getString("ImageFirstName"));
								map.put("IMAGElast_name",
										c.getString("ImageLastName"));
								map.put("IMAGETotalsLikes",
										c.getString("ImageLikes"));
								map.put("SYNtribe", c.getString("tribe"));
								map.put("SYNrole", c.getString("role"));
								map.put("VideoSyndialact",
										c.getString("VideoSyndialact"));
								map.put("SYNcurrent_location",
										c.getString("current_location"));

								map.put("UserLikedVideo",
										c.getString("UserLikedVideo"));
								map.put("VideoParentNID",
										c.getString("VideoParentNID"));
								map.put("VideoParentUID",
										c.getString("VideoParentUID"));
								map.put("TotalsSetDefaultVideo",
										c.getString("TotalsSetDefaultVideo"));
								map.put("MediaUID", c.getString("MediaUID"));
								map.put("NodeMediaType",
										c.getString("NodeMediaType"));
								map.put("UserCurateStateVideo",
										c.getString("UserCurateStateVideo"));

								// Set the JSON Objects into the array
								Log.v(TAG, "########## VIDEO #############");
								Log.v(TAG,
										"VideoParentUID      :"
												+ c.getString("VideoParentUID"));
								Log.v(TAG,
										"MediaUID            :"
												+ c.getString("MediaUID"));
								Log.v(TAG,
										"UserCurateStateVideo:"
												+ c.getString("UserCurateStateVideo"));
								videoArrayList.add(map);
							}
						} catch (Exception e) {
							Log.v(TAG, "***** Exception *****:" + e);
						}
					}

				}

			} catch (Exception e) {

			}

			// audioArrayList
			/******** Listing Video Synonyms *******************************/
			ArrayList<NameValuePair> nameValuePairsAudio = new ArrayList<NameValuePair>();
			try {
				HttpConnectionParams.setConnectionTimeout(httpParameters,
						timeoutConnection);
				HttpClient httpclient = new DefaultHttpClient(httpParameters);
				HttpPost httppost = new HttpPost(
						"http://langapp.mirzabros.com/maoriapi/curate/getNodeCurateAudioSynonyms.php");
				JSONObject json = new JSONObject();
				json.put("record1", nid);
				json.put("record2", UserID);
				json.put("record3", "1");// Media Type = Word(REF = 1)
				JSONArray postjson = new JSONArray();
				postjson.put(json);
				// Log.e("REQUEST :", "request Audio**** :" + postjson);
				httppost.setHeader("json", json.toString());
				httppost.getParams().setParameter("jsonpost", postjson);
				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairsAudio));
				HttpResponse response = httpclient.execute(httppost);
				HttpEntity entity = response.getEntity();
				is = entity.getContent();
				if (is != null) {

					BufferedReader reader = new BufferedReader(
							new InputStreamReader(is, "iso-8859-1"), 8);
					sb = new StringBuilder();
					sb.append(reader.readLine() + "\n");
					String line = "0";

					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result = sb.toString();
					if (result != null) {
						// Log.e("REQUEST :", "Synonym Audio *****:" + result);
						audioArrayList = new ArrayList<HashMap<String, String>>();
						try {
							JSONObject jsonObj = new JSONObject(result);
							jsonarray = jsonObj.getJSONArray("posts");
							for (int i = 0; i < jsonarray.length(); i++) {
								TotalsSynonimVideoValue = TotalsSynonimVideoValue + 1;

								JSONObject c = jsonarray.getJSONObject(i);
								HashMap<String, String> map = new HashMap<String, String>();
								map.put("IMAGENM_ID", c.getString("ImageID"));
								map.put("IMAGENID", c.getString("ImageNID"));
								map.put("IMAGEMID", c.getString("ImageMID"));
								map.put("IMAGEUID", c.getString("ImageUID"));
								map.put("IMAGEM_Source",
										c.getString("ImageM_Source"));
								map.put("IMAGEfirst_name",
										c.getString("ImageFirstName"));
								map.put("IMAGElast_name",
										c.getString("ImageLastName"));
								map.put("IMAGETotalsLikes",
										c.getString("ImageLikes"));
								map.put("SYNtribe", c.getString("tribe"));
								map.put("SYNrole", c.getString("role"));
								map.put("SYNcurrent_location",
										c.getString("current_location"));
								map.put("AudioSyndialact",
										c.getString("AudioSyndialact"));

								map.put("UserLikedAudio",
										c.getString("UserLikedAudio"));
								map.put("AudioParentNID",
										c.getString("AudioParentNID"));
								map.put("AudioParentUID",
										c.getString("AudioParentUID"));
								map.put("TotalsSetDefaultAudio",
										c.getString("TotalsSetDefaultAudio"));
								map.put("MediaUID", c.getString("MediaUID"));
								map.put("NodeMediaType",
										c.getString("NodeMediaType"));
								map.put("UserCurateStateAudio",
										c.getString("UserCurateStateAudio"));
								// Set the JSON Objects into the array
								Log.v(TAG, "########## AUDIO #############");
								Log.v(TAG,
										"VideoParentUID      :"
												+ c.getString("AudioParentUID"));
								Log.v(TAG,
										"MediaUID            :"
												+ c.getString("MediaUID"));
								Log.v(TAG,
										"UserCurateStateAudio:"
												+ c.getString("UserCurateStateAudio"));
								// Set the JSON Objects into the array
								audioArrayList.add(map);
							}
						} catch (Exception e) {
							Log.v(TAG, "***** Exception *****:" + e);
						}
					}

				}

			} catch (Exception e) {

			}
			/******** Listing Images Synonyms *******************************/

			ArrayList<NameValuePair> nameValuePairsImages = new ArrayList<NameValuePair>();
			try {
				HttpConnectionParams.setConnectionTimeout(httpParameters,
						timeoutConnection);
				HttpClient httpclient = new DefaultHttpClient(httpParameters);
				HttpPost httppost = new HttpPost(
						"http://langapp.mirzabros.com/maoriapi/curate/getNodeCurateImageSynonyms.php");
				JSONObject json = new JSONObject();
				json.put("record1", nid);
				json.put("record2", UserID);
				json.put("record3", "1");// Media Type = Word(REF = 1)
				JSONArray postjson = new JSONArray();
				postjson.put(json);
				// Log.e("REQUEST :", "request Images**** :" + postjson);
				httppost.setHeader("json", json.toString());
				httppost.getParams().setParameter("jsonpost", postjson);
				httppost.setEntity(new UrlEncodedFormEntity(
						nameValuePairsImages));
				HttpResponse response = httpclient.execute(httppost);
				HttpEntity entity = response.getEntity();
				is = entity.getContent();
				if (is != null) {

					BufferedReader reader = new BufferedReader(
							new InputStreamReader(is, "iso-8859-1"), 8);
					sb = new StringBuilder();
					sb.append(reader.readLine() + "\n");
					String line = "0";

					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result = sb.toString();
					if (result != null) {
						// Log.e("REQUEST :", "Synonym Images 1000*****:" +
						// result);
						imagesArrayList = new ArrayList<HashMap<String, String>>();
						try {
							JSONObject jsonObj = new JSONObject(result);
							jsonarray = jsonObj.getJSONArray("posts");
							for (int i = 0; i < jsonarray.length(); i++) {
								TotalsSynonimImagesValue = TotalsSynonimImagesValue + 1;

								JSONObject c = jsonarray.getJSONObject(i);
								HashMap<String, String> map = new HashMap<String, String>();

								map.put("IMAGENM_ID", c.getString("ImageID"));
								map.put("IMAGENID", c.getString("ImageNID"));
								map.put("IMAGEMID", c.getString("ImageMID"));
								map.put("IMAGEUID", c.getString("ImageUID"));
								map.put("IMAGEM_Source",
										c.getString("ImageM_Source"));
								map.put("IMAGEfirst_name",
										c.getString("ImageFirstName"));
								map.put("IMAGElast_name",
										c.getString("ImageLastName"));
								map.put("IMAGETotalsLikes",
										c.getString("ImageLikes"));
								map.put("SYNtribe", c.getString("tribe"));
								map.put("SYNrole", c.getString("role"));
								map.put("SYNcurrent_location",
										c.getString("current_location"));
								map.put("ImageSyndialact",
										c.getString("ImageSyndialact"));

								map.put("UserLikedImage",
										c.getString("UserLikedImage"));
								map.put("ImageParentNID",
										c.getString("ImageParentNID"));
								map.put("ImageParentUID",
										c.getString("ImageParentUID"));
								map.put("TotalsSetDefaultImage",
										c.getString("TotalsSetDefaultImage"));
								map.put("MediaUID", c.getString("MediaUID"));
								map.put("NodeMediaType",
										c.getString("NodeMediaType"));
								map.put("UserCurateStateImage",
										c.getString("UserCurateStateImage"));
								Log.v(TAG, "########## IMAGE #############");
								Log.v(TAG,
										"VideoParentUID      :"
												+ c.getString("ImageParentUID"));
								Log.v(TAG,
										"MediaUID            :"
												+ c.getString("MediaUID"));
								Log.v(TAG,
										"UserCurateStateImage:"
												+ c.getString("UserCurateStateImage"));
								// Set the JSON Objects into the array
								imagesArrayList.add(map);
							}
						} catch (Exception e) {
							Log.v(TAG, "***** Exception *****:" + e);
						}
					}

				}

			} catch (Exception e) {

			}
			return null;
		}

		@Override
		protected void onPostExecute(String args) {
			// Locate the TextViews in singleitemview.xml
			txtHeading.setText(word);
			Log.v("TAG", "XXX : "+ MainNodeUserCurateState);
			
			
			/*************** Curate *****************************/
			btn_approve.setText("Approve(" + NodeApprovalCount + ")"); 
			btn_reject.setText("Reject(" + NodeRejectedCount + ")");
			
			
			if (MainNodeUserCurateState.equals("1")) {
				curateActiveMode = 1;
				btn_approve.setCompoundDrawablesWithIntrinsicBounds(
						R.drawable.ic_default_active, 0, 0, 0);
				btn_approve.setText("Approve");
				btn_approve.setTextColor(Color.parseColor("#07afdf"));
				btn_reject.setEnabled(true);
				btn_approve.setEnabled(false);
				btn_modify.setEnabled(true);
			} else if (MainNodeUserCurateState.equals("2")) {
				curateActiveMode = 2;
				btn_reject.setEnabled(false);
				btn_approve.setEnabled(true);
				btn_modify.setEnabled(true);
				btn_reject.setText("Reject");
				btn_reject.setTextColor(Color.parseColor("#07afdf"));
				btn_reject.setCompoundDrawablesWithIntrinsicBounds(
						R.drawable.ic_reject_active, 0, 0, 0);
			} else if (MainNodeUserCurateState.equals("3")) {
				btn_reject.setEnabled(true);
				btn_approve.setEnabled(true);
				btn_modify.setEnabled(false);
				btn_modify.setText("Modify");
				btn_modify.setTextColor(Color.parseColor("#07afdf"));
				btn_modify.setCompoundDrawablesWithIntrinsicBounds(0,
						R.drawable.ic_modify_active, 0, 0);
			}
			int NodeRejectedCountVal = 0;
			int NodeApprovalCountVal = 0;
			try{
				NodeRejectedCountVal = Integer.parseInt(NodeRejectedCount.trim());
				NodeApprovalCountVal = Integer.parseInt(NodeApprovalCount.trim());
			}
			catch(Exception e){
				NodeRejectedCountVal = 0;
				NodeApprovalCountVal = 0;
			}
			

			if(NodeApprovalCountVal == 1 && NodeRejectedCountVal < 2){
				curate_state.setBackgroundResource(R.drawable.ic_star_pending);
			}
			else if(NodeRejectedCountVal == 1){
				curate_state.setBackgroundResource(R.drawable.ic_star_pending);
			}
			else if (NodeApprovalCountVal >= 2) {
				curate_state.setBackgroundResource(R.drawable.ic_star_active);
			} else if (NodeRejectedCountVal >= 2) {
				curate_state.setBackgroundResource(R.drawable.ic_star_reject);
			}

			// ------------------------------------------------

			if (UserLikedForNode.equals("0")) {
				btnlikenode.setCompoundDrawablesWithIntrinsicBounds(0,
						R.drawable.ic_like_h, 0, 0);
			} else if (UserLikedForNode.equals("1")) {
				btnlikenode.setCompoundDrawablesWithIntrinsicBounds(0,
						R.drawable.ic_like_hed, 0, 0);
			}
			if (UserNodeBookMarked.equals("0")) {
				btnbookmarknode.setCompoundDrawablesWithIntrinsicBounds(0,
						R.drawable.ic_bookmark_h, 0, 0);
			} else if (UserNodeBookMarked.equals("1")) {
				btnbookmarknode.setCompoundDrawablesWithIntrinsicBounds(0,
						R.drawable.ic_bookmark_hed, 0, 0);
			}
			if (NodeDifAudio.equals("202")) {
				btnplaynode.setCompoundDrawablesWithIntrinsicBounds(0,
						R.drawable.ic_play_inactive_h, 0, 0);
			}

			btnviewsynonims.setImageResource(R.drawable.ic_comment_h);
			TextView memdiscover_det_title = (TextView) findViewById(R.id.memdiscover_det_title);
			TextView memdiscover_det_subtitle = (TextView) findViewById(R.id.memdiscover_det_subtitle);
		
			TextView uploaduserfname = (TextView) findViewById(R.id.uploaduserfname);
			TextView uploaduserlname = (TextView) findViewById(R.id.uploaduserlname);
			ImageView upuserimage = (ImageView) findViewById(R.id.upuserimage);
			Button dicover_location = (Button) findViewById(R.id.dicover_location);
			Button display_dialect = (Button) findViewById(R.id.display_dialect);
			// Set results to the TextViews
			memdiscover_det_title.setText(word);
			memdiscover_det_subtitle.setText(maori);
			uploaduserfname.setText(first_name + " " + last_name);
			uploaduserlname.setText(tribe);
			dicover_location.setText(current_location);
			display_dialect.setText(dialact);
			try {
				ImageLoader imgLoader = new ImageLoader(getApplicationContext());
				imgLoader.DisplayImage(userimage, upuserimage);
				Log.e("TAG ", "Image : " + userimage);
			} catch (Exception e) {
				Log.e("TAG ", "Exception : " + e);
			}
			upuserimage.setImageBitmap(userbmImg);

			// TotalsLikes,TotalsSynonim,TotalImages,TotalAudios,TotalVideos
			Button wordsynonyms = (Button) findViewById(R.id.wordsynonyms);
			Button wordaudio = (Button) findViewById(R.id.wordaudio);
			Button wordimages = (Button) findViewById(R.id.wordimages);
			Button wordvideo = (Button) findViewById(R.id.wordvideo);

			wordsynonyms.setText(TotalsSynonimValue + "\nSynonyms");
			wordaudio.setText(TotalAudios + "\nAudio");
			wordimages.setText(TotalImages + "\nImages");
			wordvideo.setText(TotalVideos + "\nVideos");

			/******* List Synonyms **********/
			listview = (ListView) findViewById(R.id.listViewSynonyms);
			// Pass the results into ListViewAdapter.java
			adapter = new Maori_Curate_Idiom_Details_Adapter(
					Maori_Curate_Idiom_Details.this, arraylist);
			// Binds the Adapter to the ListView
			listview.setAdapter(adapter);
			// Close the progressdialog
			// mProgressDialog.dismiss();
			Language_App_List_Exapander.getListViewSize(listview);

			/*********** List Audio ********************/
			// Maori_Curate_Idiom_ImageList_Adapter adapterImages;
			listViewAudioSynonyms = (ListView) findViewById(R.id.listViewAudioSynonyms);
			// Pass the results into ListViewAdapter.java
			adapterAudio = new Maori_Curate_AudioList_Idiom_Adapter(
					Maori_Curate_Idiom_Details.this, audioArrayList);
			// Binds the Adapter to the ListView
			listViewAudioSynonyms.setAdapter(adapterAudio);
			// Close the progressdialog
			// mProgressDialog.dismiss();
			Language_App_List_Exapander.getListViewSize(listViewAudioSynonyms);

			listViewImageSynonyms = (ListView) findViewById(R.id.listViewImageSynonyms);
			// Pass the results into ListViewAdapter.java
			adapterImages = new Maori_Curate_ImageList_Idiom_Adapter(
					Maori_Curate_Idiom_Details.this, imagesArrayList);
			// Binds the Adapter to the ListView
			listViewImageSynonyms.setAdapter(adapterImages);
			// Close the progressdialog
			// mProgressDialog.dismiss();
			Language_App_List_Exapander.getListViewSize(listViewImageSynonyms);

			// Maori_Curate_Idiom_VideoList_Adapter adapterVideos;
			listViewVideoSynonyms = (ListView) findViewById(R.id.listViewVideoSynonyms);
			// Pass the results into ListViewAdapter.java
			adapterVideos = new Maori_Curate_VideoList_Idiom_Adapter(
					Maori_Curate_Idiom_Details.this, videoArrayList);
			// Binds the Adapter to the ListView
			listViewVideoSynonyms.setAdapter(adapterVideos);
			// Close the progressdialog
			mProgressDialog.dismiss();
			Language_App_List_Exapander.getListViewSize(listViewVideoSynonyms);
			TotalsSynonimValue = 0;
			TotalsSynonimImagesValue = 0;

		}
	}

	/********************************************************************
	 ************* UPLOADING SYNONIMS
	 *************************************/
	private class UploadingSynonimDetails extends AsyncTask<Void, Void, Void> {
		private final String TAG = null;

		@Override
		protected void onPreExecute() {
			super.onPreExecute();
			// Create a progressdialog
			mProgressDialog = new ProgressDialog(
					Maori_Curate_Idiom_Details.this);
			mProgressDialog.setMax(100);
			mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
			mProgressDialog.setCancelable(false);
			// Set progressdialog title
			mProgressDialog.setTitle("Uploading");
			// Set progressdialog message
			mProgressDialog.setMessage("Uploading Synonyms");
			mProgressDialog.setIndeterminate(false);
			// Show progressdialog
			mProgressDialog.show();

		}

		@Override
		protected Void doInBackground(Void... params) {
			// TODO Auto-generated method stub
			ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
			try {
				HttpPost httppost = null;
				HttpConnectionParams.setConnectionTimeout(httpParameters,
						timeoutConnection);
				HttpClient httpclient = new DefaultHttpClient(httpParameters);
				httppost = new HttpPost(saveSaveSynonimAUrl);
				JSONObject json = new JSONObject();
				// Selected Type ID / content_type_id
				json.put("record1", "5");
				// Selected UID / added_by
				json.put("record2", UserID);
				// Record Added Date /added_on
				json.put("record3", getAddDateTimeString().toString());
				// Record dialect_id
				json.put("record4", "1");
				// Curent Node Category ID
				json.put("record5", MID);
				// Curent Node Category LINKNID / parent node id
				json.put("record6", nid);
				// Curent LID - language ids
				json.put("record7", "1=2"); // LID
				// Curent uploading contents
				json.put("record8", etmaorisynonimword.getText().toString()
						+ "=" + etenglishsynonimword.getText().toString()); // LID
				JSONArray postjson = new JSONArray();
				postjson.put(json);

				httppost.setHeader("json", json.toString());
				httppost.getParams().setParameter("jsonpost", postjson);
				Log.e("postjson", "postjson XXX :" + postjson.toString()
						+ " = " + MID);

				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
				HttpResponse response = httpclient.execute(httppost);
				HttpEntity entity = response.getEntity();
				is = entity.getContent();
				if (is != null) {

					BufferedReader reader = new BufferedReader(
							new InputStreamReader(is, "iso-8859-1"), 8);
					sb = new StringBuilder();
					sb.append(reader.readLine() + "\n");
					String line = "0";

					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result = sb.toString();
					if (result != null) {

					}
				}
			} catch (Exception e) {
				e.printStackTrace();
			}
			return null;
		}

		@Override
		protected void onPostExecute(Void args) {
			listViewSynonyms.setVisibility(LinearLayout.VISIBLE);
			capturesynonims.setVisibility(LinearLayout.GONE);
			searchviewarea.setVisibility(LinearLayout.GONE);
			capturesynonimsaudio.setVisibility(LinearLayout.GONE);
			capturesynonimsimages.setVisibility(LinearLayout.GONE);
			captureActionControllers.setVisibility(LinearLayout.GONE);
			etmaorisynonimword.setText("");
			etenglishsynonimword.setText("");
			final AlertDialog alertDialog = new AlertDialog.Builder(
					Maori_Curate_Idiom_Details.this).create();
			// Setting Dialog Title
			alertDialog.setTitle("Uploaded");
			// Setting Dialog Message
			alertDialog.setMessage("Upload Completed..");
			// Setting OK Button
			alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					new loadSingleView().execute();
					alertDialog.dismiss();
				}
			});
			// Showing Alert Message
			alertDialog.show();
			alertDialog.setCanceledOnTouchOutside(false);
			mProgressDialog.dismiss();
		}
	}

	/************** Uploading Image Details ********************************/
	private class UploadImageDetails extends AsyncTask<Void, Void, Void> {
		@Override
		protected void onPreExecute() {
			super.onPreExecute();
			// Create a progressdialog
			mProgressDialog = new ProgressDialog(
					Maori_Curate_Idiom_Details.this);
			mProgressDialog.setMax(100);
			mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
			mProgressDialog.setCancelable(false);
			// Set progressdialog title
			mProgressDialog.setTitle("Uploading");
			// Set progressdialog message
			mProgressDialog.setMessage("Uploading Image Details");
			mProgressDialog.setIndeterminate(false);
			// Show progressdialog
			mProgressDialog.show();

		}

		@Override
		protected Void doInBackground(Void... params) {
			// TODO Auto-generated method stub
			ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
			try {
				HttpPost httppost = null;
				HttpConnectionParams.setConnectionTimeout(httpParameters,
						timeoutConnection);
				HttpClient httpclient = new DefaultHttpClient(httpParameters);
				httppost = new HttpPost(
						"http://langapp.mirzabros.com/maoriapi/saveSynonymImages.php");
				JSONObject json = new JSONObject();
				// Sending Node ID
				json.put("record1", nid);
				// Server URL
				json.put("record2", "http://langapp.mirzabros.com/lanappimage/"
						+ filename);
				json.put("record3", SelectedDialect);
				json.put("record4", UserID);
				JSONArray postjson = new JSONArray();
				postjson.put(json);

				httppost.setHeader("json", json.toString());
				httppost.getParams().setParameter("jsonpost", postjson);
				Log.e("postjson", "postjson XXX :" + postjson.toString()
						+ " = " + MID);
				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
				HttpResponse response = httpclient.execute(httppost);
				HttpEntity entity = response.getEntity();
				is = entity.getContent();
				if (is != null) {

					BufferedReader reader = new BufferedReader(
							new InputStreamReader(is, "iso-8859-1"), 8);
					sb = new StringBuilder();
					sb.append(reader.readLine() + "\n");
					String line = "0";

					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result = sb.toString();
					if (result != null) {

					}
				}
			} catch (Exception e) {

			}
			return null;
		}

		@Override
		protected void onPostExecute(Void args) {
			// mProgressDialog.dismiss();
			new UploadTaskImages().execute();
		}
	}

	/************** Uploading Video Details ********************************/
	private class UploadVideoDetails extends AsyncTask<Void, Void, Void> {
		@Override
		protected void onPreExecute() {
			super.onPreExecute();
			// Create a progressdialog
			mProgressDialog = new ProgressDialog(
					Maori_Curate_Idiom_Details.this);
			mProgressDialog.setMax(100);
			mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
			mProgressDialog.setCancelable(false);
			// Set progressdialog title
			mProgressDialog.setTitle("Uploading");
			// Set progressdialog message
			mProgressDialog.setMessage("Uploading Video Details");
			mProgressDialog.setIndeterminate(false);
			// Show progressdialog
			mProgressDialog.show();

		}

		@Override
		protected Void doInBackground(Void... params) {
			// TODO Auto-generated method stub
			ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
			try {
				HttpPost httppost = null;
				HttpConnectionParams.setConnectionTimeout(httpParameters,
						timeoutConnection);
				HttpClient httpclient = new DefaultHttpClient(httpParameters);
				httppost = new HttpPost(
						"http://langapp.mirzabros.com/maoriapi/saveSynonymVideo.php");
				JSONObject json = new JSONObject();
				// Sending Node ID
				json.put("record1", nid);
				// Server URL
				json.put("record2", "http://langapp.mirzabros.com/lanappvideo/"
						+ currentVideoName);
				json.put("record3", SelectedDialect);
				json.put("record4", UserID);
				JSONArray postjson = new JSONArray();
				postjson.put(json);

				httppost.setHeader("json", json.toString());
				httppost.getParams().setParameter("jsonpost", postjson);
				Log.e("postjson", "postjson XXX :" + postjson.toString()
						+ " = " + MID);

				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
				HttpResponse response = httpclient.execute(httppost);
				HttpEntity entity = response.getEntity();
				is = entity.getContent();
				if (is != null) {

					BufferedReader reader = new BufferedReader(
							new InputStreamReader(is, "iso-8859-1"), 8);
					sb = new StringBuilder();
					sb.append(reader.readLine() + "\n");
					String line = "0";

					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result = sb.toString();
					if (result != null) {

					}
				}
			} catch (Exception e) {

			}
			return null;
		}

		@Override
		protected void onPostExecute(Void args) {
			// mProgressDialog.dismiss();
			new UploadTaskVideo().execute();
		}
	}

	/************** Uploading Audio Details ********************************/
	private class UploadAudioDetails extends AsyncTask<Void, Void, Void> {
		@Override
		protected void onPreExecute() {
			super.onPreExecute();
			// Create a progressdialog
			mProgressDialog = new ProgressDialog(
					Maori_Curate_Idiom_Details.this);
			mProgressDialog.setMax(100);
			mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
			mProgressDialog.setCancelable(false);
			// Set progressdialog title
			mProgressDialog.setTitle("Uploading");
			// Set progressdialog message
			mProgressDialog.setMessage("Uploading Audio Details");
			mProgressDialog.setIndeterminate(false);
			// Show progressdialog
			mProgressDialog.show();

		}

		@Override
		protected Void doInBackground(Void... params) {
			// TODO Auto-generated method stub
			ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
			try {
				HttpPost httppost = null;
				HttpConnectionParams.setConnectionTimeout(httpParameters,
						timeoutConnection);
				HttpClient httpclient = new DefaultHttpClient(httpParameters);
				httppost = new HttpPost(
						"http://langapp.mirzabros.com/maoriapi/saveSynonymAudio.php");
				JSONObject json = new JSONObject();
				// Sending Node ID
				json.put("record1", nid);
				// Server URL
				json.put("record2", "http://langapp.mirzabros.com/lanappaudio/"
						+ currentAudioName);
				json.put("record3", SelectedDialect);
				json.put("record4", UserID);
				JSONArray postjson = new JSONArray();
				postjson.put(json);

				httppost.setHeader("json", json.toString());
				httppost.getParams().setParameter("jsonpost", postjson);
				Log.e("postjson", "postjson XXX :" + postjson.toString()
						+ " = " + MID);

				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
				HttpResponse response = httpclient.execute(httppost);
				HttpEntity entity = response.getEntity();
				is = entity.getContent();
				if (is != null) {

					BufferedReader reader = new BufferedReader(
							new InputStreamReader(is, "iso-8859-1"), 8);
					sb = new StringBuilder();
					sb.append(reader.readLine() + "\n");
					String line = "0";

					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result = sb.toString();
					if (result != null) {

					}
				}
			} catch (Exception e) {

			}
			return null;
		}

		@Override
		protected void onPostExecute(Void args) {
			// mProgressDialog.dismiss();
			new UploadTask().execute();
		}
	}

	private class UploadingWordsDetails extends AsyncTask<Void, Void, Void> {
		@Override
		protected void onPreExecute() {
			super.onPreExecute();
			// Create a progressdialog
			mProgressDialog = new ProgressDialog(
					Maori_Curate_Idiom_Details.this);
			mProgressDialog.setMax(100);
			mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
			mProgressDialog.setCancelable(false);
			// Set progressdialog title
			mProgressDialog.setTitle("Uploading");
			// Set progressdialog message
			mProgressDialog.setMessage("Uploading Synonyms");
			mProgressDialog.setIndeterminate(false);
			// Show progressdialog
			mProgressDialog.show();

		}

		@Override
		protected Void doInBackground(Void... arg0) {
			// TODO Auto-generated method stub
			ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
			try {
				HttpPost httppost = null;
				HttpConnectionParams.setConnectionTimeout(httpParameters,
						timeoutConnection);
				HttpClient httpclient = new DefaultHttpClient(httpParameters);
				httppost = new HttpPost(saveSaveSynonimAUrl);
				JSONObject json = new JSONObject();
				// Selected Type ID / content_type_id
				json.put("record1", "1");
				// Selected UID / added_by
				json.put("record2", UserID);
				// Record Added Date /added_on
				json.put("record3", getAddDateTimeString().toString());
				// Record dialect_id
				json.put("record4", "1");
				// Curent Node Category ID
				json.put("record5", MID);
				// Curent Node Category LINKNID / parent node id
				json.put("record6", nid);
				// Curent LID - language ids
				json.put("record7", "1=2"); // LID
				// Curent uploading contents
				json.put("record8", etmaorisynonimword.getText().toString()
						+ "=" + etenglishsynonimword.getText().toString()); // LID

				JSONArray postjson = new JSONArray();
				postjson.put(json);

				httppost.setHeader("json", json.toString());
				httppost.getParams().setParameter("jsonpost", postjson);
				Log.e("postjson", "postjson :" + postjson.toString());

				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
				HttpResponse response = httpclient.execute(httppost);
				HttpEntity entity = response.getEntity();
				is = entity.getContent();
				if (is != null) {

					BufferedReader reader = new BufferedReader(
							new InputStreamReader(is, "iso-8859-1"), 8);
					sb = new StringBuilder();
					sb.append(reader.readLine() + "\n");
					String line = "0";

					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result = sb.toString();
					if (result != null) {

					}
				}

			} catch (Exception e) {
				e.printStackTrace();
			}
			return null;
		}

		@Override
		protected void onPostExecute(Void args) {
			mProgressDialog.dismiss();

		}

	}

	private String getAddDateTimeString() {
		Calendar cad = Calendar.getInstance();
		SimpleDateFormat dfad = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
		String formattedAddDate = dfad.format(cad.getTime());
		return formattedAddDate;
	}

	private String getAudiorecording() {
		Calendar cad = Calendar.getInstance();
		SimpleDateFormat dfad = new SimpleDateFormat("yyyyMMddHHmmss");
		String formattedAddDate = dfad.format(cad.getTime());
		return formattedAddDate;
	}

	public boolean isNetworkAvailable() {
		ConnectivityManager connectivity = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
		if (connectivity == null) {
			return false;
		} else {
			NetworkInfo[] info = connectivity.getAllNetworkInfo();
			if (info != null) {
				for (int i = 0; i < info.length; i++) {
					if (info[i].getState() == NetworkInfo.State.CONNECTED) {
						return true;
					}
				}
			}
		}
		return false;
	}

	/**************** Uploading Audio Via FTP ************************/
	class UploadTask extends AsyncTask<Void, Void, Void> {

		ProgressDialog pDialog;
		Boolean uploadStat;

		@Override
		protected void onPreExecute() {
			/*
			 * pDialog = new ProgressDialog(Maori_Curate_Idiom_Details.this);
			 * pDialog.setMessage("Uploading Audio Files..."); pDialog.show();
			 */
			super.onPreExecute();
		}

		@Override
		protected Void doInBackground(Void... params) {
			Log.v(TAG, "data uploading 1 : " + upladingFromPathAudio);
			Log.v(TAG, "data uploading 2 : " + currentAudioName);
			Log.v(TAG, "data uploading 3 : " + desDirectoryAudio);

			uploadStat = new UploadToFtpAudio().ftpUpload1(
					upladingFromPathAudio, currentAudioName, desDirectoryAudio);
			runOnUiThread(new Runnable() {

				@Override
				public void run() {
					if (uploadStat) {

					} else {
						AlertDialog.Builder b = new AlertDialog.Builder(
								Maori_Curate_Idiom_Details.this);
						b.setMessage("Upload Failed.");
						b.show();
					}

				}
			});
			return null;
		}

		@Override
		protected void onPostExecute(Void result) {
			if (null != pDialog && pDialog.isShowing()) {
				pDialog.dismiss();
			}
			mProgressDialog.dismiss();
			super.onPostExecute(result);
			final AlertDialog alertDialog = new AlertDialog.Builder(
					Maori_Curate_Idiom_Details.this).create();
			// Setting Dialog Title
			alertDialog.setTitle("UPLOAD COMPLETED");
			// Setting Dialog Message
			alertDialog.setMessage("Audio Uploaded Successfully...");
			// Setting OK Button
			alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					capturesynonims.setVisibility(LinearLayout.GONE);
					captureActionControllers.setVisibility(LinearLayout.GONE);
					capturesynonimsaudio.setVisibility(LinearLayout.GONE);
					capturesynonimsimages.setVisibility(LinearLayout.GONE);
					listViewSynonyms.setVisibility(LinearLayout.VISIBLE);
					if (AudioTag == 202) {
						wordsynonyms
								.setBackgroundResource(R.drawable.left_orange_round_button_background);
						// btnviewsynonims.setImageResource(R.drawable.iconj);
						wordimages
								.setBackgroundResource(R.drawable.left_squire_button_background);
						wordaudio
								.setBackgroundResource(R.drawable.left_squire_button_background);
						listViewSynonyms.setVisibility(LinearLayout.VISIBLE);
						SynonimTag = 202;
					}

					new loadSingleView().execute();
					alertDialog.dismiss();
				}
			});
			// Showing Alert Message
			alertDialog.show();
			alertDialog.setCanceledOnTouchOutside(false);
			return;
		}
	}

	/**************** Uploading Images Via FTP ************************/
	class UploadTaskImages extends AsyncTask<Void, Void, Void> {

		ProgressDialog pDialog;
		Boolean uploadStat;

		@Override
		protected void onPreExecute() {
			/*
			 * pDialog = new ProgressDialog(Maori_Curate_Idiom_Details.this);
			 * pDialog.setMessage("Uploading Image Files..."); pDialog.show();
			 */
			super.onPreExecute();
		}

		@Override
		protected Void doInBackground(Void... params) {
			// upladingFromPath = "/storage/emulated/0/Pictures/lANGUAGEAPP/";
			Log.v(TAG, "data uploading 1 : " + upladingFromPath);
			Log.v(TAG, "data uploading 2 : " + filename);
			Log.v(TAG, "data uploading 3 : " + desDirectoryImage);

			uploadStat = new UploadToFtp().ftpUpload1(upladingFromPath,
					filename, desDirectoryImage);
			runOnUiThread(new Runnable() {

				@Override
				public void run() {
					if (uploadStat) {

					} else {
						AlertDialog.Builder b = new AlertDialog.Builder(
								Maori_Curate_Idiom_Details.this);
						b.setMessage("Upload Failed.");
						b.show();
					}

				}
			});
			return null;
		}

		@Override
		protected void onPostExecute(Void result) {
			if (null != pDialog && pDialog.isShowing()) {
				pDialog.dismiss();
			}
			super.onPostExecute(result);
			mProgressDialog.dismiss();
			final AlertDialog alertDialog = new AlertDialog.Builder(
					Maori_Curate_Idiom_Details.this).create();
			// Setting Dialog Title
			alertDialog.setTitle("UPLOAD COMPLETED");
			// Setting Dialog Message
			alertDialog.setMessage("Image Uploaded Successfully...");
			// Setting OK Button
			alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					capturesynonims.setVisibility(LinearLayout.GONE);
					captureActionControllers.setVisibility(LinearLayout.GONE);
					capturesynonimsaudio.setVisibility(LinearLayout.GONE);
					capturesynonimsimages.setVisibility(LinearLayout.GONE);
					listViewSynonyms.setVisibility(LinearLayout.VISIBLE);
					if (ImageTag == 202) {
						wordsynonyms
								.setBackgroundResource(R.drawable.left_orange_round_button_background);
						// btnviewsynonims.setImageResource(R.drawable.iconj);
						wordimages
								.setBackgroundResource(R.drawable.left_squire_button_background);
						listViewSynonyms.setVisibility(LinearLayout.VISIBLE);
						SynonimTag = 202;
					}
					new loadSingleView().execute();
					alertDialog.dismiss();
				}
			});
			// Showing Alert Message
			alertDialog.show();
			alertDialog.setCanceledOnTouchOutside(false);
			return;
		}
	}

	/**
	 * Receiving activity result method will be called after closing the camera
	 * */
	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		// if the result is capturing Image
		if (requestCode == CAMERA_CAPTURE_IMAGE_REQUEST_CODE) {
			if (resultCode == RESULT_OK) {
				// successfully captured the image
				// display it in image view
				previewCapturedImage();
			} else if (resultCode == RESULT_CANCELED) {
				// user cancelled Image capture
				Toast.makeText(getApplicationContext(),
						"User cancelled image capture", Toast.LENGTH_SHORT)
						.show();
			} else {
				// failed to capture image
				Toast.makeText(getApplicationContext(),
						"Sorry! Failed to capture image", Toast.LENGTH_SHORT)
						.show();
			}
		} else if (requestCode == CAMERA_CAPTURE_VIDEO_REQUEST_CODE) {
			camvideoparent.setVisibility(View.VISIBLE);
			if (resultCode == RESULT_OK) {
				// video successfully recorded
				// preview the recorded video
				camvideoparent.setVisibility(View.VISIBLE);
				previewVideo();
			} else if (resultCode == RESULT_CANCELED) {
				// user cancelled recording
				Toast.makeText(getApplicationContext(),
						"User cancelled video recording", Toast.LENGTH_SHORT)
						.show();
			} else {
				// failed to record video
				Toast.makeText(getApplicationContext(),
						"Sorry! Failed to record video", Toast.LENGTH_SHORT)
						.show();
			}
		}

		else if (resultCode == Activity.RESULT_OK) {
			if (requestCode == PICK_IMAGE) {
				selectedImageUri = data.getData();
				// Log.e("Bitmap", "selectedImageUri :" + selectedImageUri);
				try {
					// OI FILE Manager
					filemanagerstring = selectedImageUri.getPath();
					// Log.e("TAG", "IMAGE PATH  100:" + filemanagerstring);
					// MEDIA GALLERY
					selectedImagePath = getPath(selectedImageUri);
					// Log.e("TAG", "IMAGE PATH  200:" + selectedImagePath);
					if (selectedImagePath != null) {
						filePath = selectedImagePath;
					} else if (filemanagerstring != null) {
						filePath = filemanagerstring;
					} else {
						Toast.makeText(getApplicationContext(), "Unknown path",
								Toast.LENGTH_LONG).show();
						// Log.e("Bitmap", "Unknown Path");
					}
					if (filePath != null) {
						decodeFile(filePath);
					} else {
						bitmap = null;
					}
					String[] projection = { MediaStore.MediaColumns.DISPLAY_NAME };
					ContentResolver cr = getApplicationContext()
							.getContentResolver();
					Cursor metaCursor = cr.query(selectedImageUri, projection,
							null, null, null);
					if (metaCursor != null) {
						try {
							if (metaCursor.moveToFirst()) {
								filename = metaCursor.getString(0);
								// Log.v(TAG, "Image NAME 9999: " + filename);
								upladingFromPath = filePath.replace(
										filename.trim(), "");
								// Log.v(TAG, "Image NAME Path 9999: " +
								// upladingFromPathAudio);
							}
						} finally {
							metaCursor.close();
						}
					}
					upladingFromPath = filePath.replace(filename.trim(), "");
					filename = filename.trim();

					Log.e("TAG", "IMAGE PATH  199:" + upladingFromPath);
					Log.e("TAG", "IMAGE PATH  299:" + filename);
					Log.e("TAG", "IMAGE PATH  300:" + filePath + " = "
							+ upladingFromPath);

				} catch (Exception e) {
					Toast.makeText(getApplicationContext(), "Internal error",
							Toast.LENGTH_LONG).show();
					Log.e(e.getClass().getName(), e.getMessage(), e);
				}
			}

			else if (requestCode == SELECT_AUDIO) {

				try {
					Uri selectedImageUri = data.getData();
					selectedPath = getPath(selectedImageUri);
					outputFile = getPath(selectedImageUri);

					String[] projection = { MediaStore.MediaColumns.DISPLAY_NAME };
					ContentResolver cr = getApplicationContext()
							.getContentResolver();
					Cursor metaCursor = cr.query(selectedImageUri, projection,
							null, null, null);
					if (metaCursor != null) {
						try {
							if (metaCursor.moveToFirst()) {
								currentAudioName = metaCursor.getString(0);
								// Log.v(TAG, "AUDIO NAME : " +
								// currentAudioName);
								upladingFromPathAudio = selectedPath.replace(
										currentAudioName.trim(), "");
								// Log.v(TAG, "AUDIO NAME File Path : " +
								// upladingFromPathAudio);
							}
						} finally {
							metaCursor.close();
						}
					}

				} catch (FileNotFoundException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				// Log.v("TAG", "AUDIO GALLERY PATH :" + selectedPath);
				// System.out.println("SELECT_AUDIO Path : " + selectedPath);

			} else if (requestCode == SELECT_VIDEO) {

				try {
					Uri selectedImageUri = data.getData();
					fileUri = data.getData();
					selectedPath = getPath(selectedImageUri);
					outputFile = getPath(selectedImageUri);
					// Log.v(TAG, "VIDEO PATH : " + selectedPath);
					String[] projection = { MediaStore.MediaColumns.DISPLAY_NAME };
					ContentResolver cr = getApplicationContext()
							.getContentResolver();
					Cursor metaCursor = cr.query(selectedImageUri, projection,
							null, null, null);
					if (metaCursor != null) {
						try {
							if (metaCursor.moveToFirst()) {
								currentVideoName = metaCursor.getString(0);
								upladingFromPathVideo = selectedPath.replace(
										currentVideoName.trim(), "");
							}
						} finally {
							metaCursor.close();
						}
					}
					Log.v(TAG, "VIDEO NAME : " + currentVideoName);
					Log.v(TAG, "VIDEO PATH : " + upladingFromPathVideo);

				} catch (FileNotFoundException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}

	}

	/*************** Image Capture Activities ******************/
	private String getPath(Uri selectedImageUri) throws FileNotFoundException {

		String[] projection = { MediaStore.Images.Media.DATA };
		Cursor cursor = managedQuery(selectedImageUri, projection, null, null,
				null);

		if (cursor != null) {

			int column_index = cursor
					.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);

			cursor.moveToFirst();
			/* Uri uri = Uri.parse(cursor.getString(1)); */

			return cursor.getString(column_index);
		} else
			return null;
	}

	private String decodeFile(String filePath) {
		// Decode image size
		BitmapFactory.Options o = new BitmapFactory.Options();
		o.inJustDecodeBounds = true;
		BitmapFactory.decodeFile(filePath, o);

		// The new size we want to scale to
		final int REQUIRED_SIZE = 1024 * 4;

		// Find the correct scale value. It should be the power of 2.
		int width_tmp = o.outWidth, height_tmp = o.outHeight;
		int scale = 1;
		while (true) {
			if (width_tmp < REQUIRED_SIZE && height_tmp < REQUIRED_SIZE)
				break;
			width_tmp /= 2;
			height_tmp /= 2;
			scale *= 2;
		}

		BitmapFactory.Options o2 = new BitmapFactory.Options();
		o2.inSampleSize = scale;

		bitmap = BitmapFactory.decodeFile(filePath, o2);
		SynonymImages.setImageBitmap(bitmap);

		Calendar c = Calendar.getInstance();
		SimpleDateFormat dfsigdate = new SimpleDateFormat("yyyyMMddHHmmss");
		String formattedSigDatep = dfsigdate.format(c.getTime());
		tempDir = "/data/data/com.maori.languageapp/CAMIMAGES/";
		Log.v(TAG, "XXX tempDir : " + tempDir);
		prepareDirectory();
		String filenamepath = tempDir + getAudiorecording().toString() + ".png";
		currentImageName = getAudiorecording().toString() + ".png";

		Log.v(TAG, "XXX tempDir : " + filenamepath);
		File dest = new File(filenamepath);
		try {
			FileOutputStream out = new FileOutputStream(dest);
			bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
			out.flush();
			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			Log.v(TAG, "Exception : " + e);
		}

		return filePath;
	}

	private boolean prepareDirectory() {
		try {
			if (makedirs()) {
				return true;
			} else {
				return false;
			}
		} catch (Exception e) {
			e.printStackTrace();
			Toast.makeText(
					this,
					"Could not initiate File System.. Is Sdcard mounted properly?",
					Toast.LENGTH_SHORT).show();
			return false;
		}
	}

	private boolean makedirs() {
		File tempdir = new File(tempDir);
		if (!tempdir.exists())
			tempdir.mkdirs();

		if (tempdir.isDirectory()) {

		}
		return (tempdir.isDirectory());
	}

	/************* Video Recording and Preview *************************/
	/**
	 * ------------ Helper Methods ----------------------
	 * */

	public void openPath(Uri uri) {
		InputStream is = null;
		try {
			is = getContentResolver().openInputStream(uri);

			// Convert your stream to data here
			is.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	/*
	 * Previewing recorded video
	 */
	private void previewVideo() {
		try {
			// hide image preview
			// imgPreview.setVisibility(View.GONE);
			capturesynonimsvideo.setVisibility(LinearLayout.VISIBLE);
			camvideoparent.setVisibility(LinearLayout.VISIBLE);
			// camvideoparent.setVisibility(View.VISIBLE);
			videoPreview.setVideoPath(fileUri.getPath());
			// start playing
			videoPreview.start();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**************** Uploading Video Via FTP ************************/
	class UploadTaskVideo extends AsyncTask<Void, Void, Void> {

		ProgressDialog pDialog;
		Boolean uploadStat;

		@Override
		protected void onPreExecute() {
			/*
			 * pDialog = new ProgressDialog(Maori_Curate_Idiom_Details.this);
			 * pDialog.setMessage("Uploading Video Files..."); pDialog.show();
			 */
			super.onPreExecute();
		}

		@Override
		protected Void doInBackground(Void... params) {
			// /Pictures/lANGUAGEAPP
			Log.v(TAG, "UPLOAD VIDEO 1 : " + upladingFromPathVideo);
			Log.v(TAG, "UPLOAD VIDEO 2 : " + currentVideoName);
			Log.v(TAG, "UPLOAD VIDEO 3 : " + desDirectory);

			uploadStat = new UploadToFtpVideo().ftpUpload1(
					upladingFromPathVideo, currentVideoName, desDirectory);
			runOnUiThread(new Runnable() {

				@Override
				public void run() {
					if (uploadStat) {

					} else {
						AlertDialog.Builder b = new AlertDialog.Builder(
								Maori_Curate_Idiom_Details.this);
						b.setMessage("Upload Failed.");
						b.show();
					}

				}
			});
			return null;
		}

		@Override
		protected void onPostExecute(Void result) {
			if (null != pDialog && pDialog.isShowing()) {
				pDialog.dismiss();
			}
			mProgressDialog.dismiss();
			super.onPostExecute(result);

			final AlertDialog alertDialog = new AlertDialog.Builder(
					Maori_Curate_Idiom_Details.this).create();
			// Setting Dialog Title
			alertDialog.setTitle("UPLOAD COMPLETED");
			// Setting Dialog Message
			alertDialog.setMessage("Video Uploaded Successfully...");
			// Setting OK Button
			alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					capturesynonims.setVisibility(LinearLayout.GONE);
					captureActionControllers.setVisibility(LinearLayout.GONE);
					capturesynonimsaudio.setVisibility(LinearLayout.GONE);
					capturesynonimsimages.setVisibility(LinearLayout.GONE);
					capturesynonimsvideo.setVisibility(LinearLayout.GONE);
					camvideoparent.setVisibility(LinearLayout.GONE);
					listViewSynonyms.setVisibility(LinearLayout.VISIBLE);
					if (VideoTag == 202) {
						wordsynonyms
								.setBackgroundResource(R.drawable.left_orange_round_button_background);
						// btnviewsynonims.setImageResource(R.drawable.iconj);
						wordimages
								.setBackgroundResource(R.drawable.left_squire_button_background);
						wordvideo
								.setBackgroundResource(R.drawable.right_round_button_background);
						listViewSynonyms.setVisibility(LinearLayout.VISIBLE);
						SynonimTag = 202;
					}
					new loadSingleView().execute();
					alertDialog.dismiss();
				}
			});
			// Showing Alert Message
			alertDialog.show();
			alertDialog.setCanceledOnTouchOutside(false);
			return;

		}
	}

	/**************** Uploading Book Mark details ***************************/
	private class UploadBookMarkDetails extends AsyncTask<Void, Void, Void> {
		private final String TAG = null;

		@Override
		protected void onPreExecute() {
			super.onPreExecute();
		}

		@Override
		protected Void doInBackground(Void... params) {
			// TODO Auto-generated method stub
			ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
			try {
				HttpPost httppost = null;
				HttpConnectionParams.setConnectionTimeout(httpParameters,
						timeoutConnection);
				HttpClient httpclient = new DefaultHttpClient(httpParameters);
				JSONObject json = new JSONObject();
				if (HeaderBtnTag == 100) {
					httppost = new HttpPost(
							"http://langapp.mirzabros.com/maoriapi/saveNodeBookMark.php");
					// Selected Type ID / content_type_id
					json.put("record1", nid);
					// Selected UID / added_by
					json.put("record2", UserID);

					json.put("record3", "0");
					Log.v("TAG", "XXXX : " + nid + "****" + UserID);

				} else if (HeaderBtnTag == 300) {
					httppost = new HttpPost(
							"http://langapp.mirzabros.com/maoriapi/saveNodeLike.php");
					// Log.v("TAG", "Like : saveNodeLike: nid" +nid + "| UserID"
					// + UserID);
					// Selected Type ID / content_type_id
					json.put("record1", nid);
					// Selected UID / added_by
					json.put("record2", UserID);

					json.put("record3", "0");
				}

				JSONArray postjson = new JSONArray();
				postjson.put(json);

				httppost.setHeader("json", json.toString());
				httppost.getParams().setParameter("jsonpost", postjson);
				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
				HttpResponse response = httpclient.execute(httppost);
				HttpEntity entity = response.getEntity();
				is = entity.getContent();
				if (is != null) {

					BufferedReader reader = new BufferedReader(
							new InputStreamReader(is, "iso-8859-1"), 8);
					sb = new StringBuilder();
					sb.append(reader.readLine() + "\n");
					String line = "0";

					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result = sb.toString();
					if (result != null) {

					}
				}
			} catch (Exception e) {
				e.printStackTrace();
			}
			return null;
		}

		@Override
		protected void onPostExecute(Void args) {
			HeaderBtnTag = 0;

		}
	}

	/**********************************************************************/

	public class UploadSynonimLikes extends AsyncTask<String, String, String> {
		@Override
		protected void onPreExecute() {
			super.onPreExecute();
		}

		@Override
		protected String doInBackground(String... params) {
			// TODO Auto-generated method stub
			HeaderBtnTag = 0;
			arraylist.clear();
			// ******** Listing Words Synonyms
			// *******************************//*
			ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
			try {
				HttpConnectionParams.setConnectionTimeout(httpParameters,
						timeoutConnection);
				HttpClient httpclient = new DefaultHttpClient(httpParameters);
				HttpPost httppost = new HttpPost(
						"http://langapp.mirzabros.com/maoriapi/getCurrentIdiomSynonyms.php");
				JSONObject json = new JSONObject();
				String[] LikeRefIdArray = LikeRefId.split("/");

				String synNID = LikeRefIdArray[0]; // NID
				String synUID = LikeRefIdArray[1]; // NID
				Log.e("@@@@@@@@@@@", "synNID@@@@ 100:" + synNID);
				Log.e("@@@@@@@@@@@", "synUID@@@@ 200:" + synUID);
				json.put("record1", synNID);
				JSONArray postjson = new JSONArray();
				postjson.put(json);
				httppost.setHeader("json", json.toString());
				httppost.getParams().setParameter("jsonpost", postjson);
				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
				HttpResponse response = httpclient.execute(httppost);
				HttpEntity entity = response.getEntity();
				is = entity.getContent();
				if (is != null) {

					BufferedReader reader = new BufferedReader(
							new InputStreamReader(is, "iso-8859-1"), 8);
					sb = new StringBuilder();
					sb.append(reader.readLine() + "\n");
					String line = "0";

					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result = sb.toString();
					if (result != null) {
						Log.e("REQUEST :", "Synonym Res DDD*****:" + result);
						arraylist = new ArrayList<HashMap<String, String>>();
						try {
							JSONObject jsonObj = new JSONObject(result);
							jsonarray = jsonObj.getJSONArray("posts");
							int cynonimval = 0;
							for (int i = 0; i < jsonarray.length(); i++) {
								JSONObject c = jsonarray.getJSONObject(i);
								HashMap<String, String> map = new HashMap<String, String>();
								TotalsSynonimValue = TotalsSynonimValue + 1;

								map.put("Description_a",
										c.getString("Description_a"));
								map.put("Description_b",
										c.getString("Description_b"));
								map.put("first_namesuser",
										c.getString("first_namesuser"));
								map.put("last_nameuser",
										c.getString("last_nameuser"));
								map.put("tribeuser", c.getString("tribeuser"));
								// Sorce URL
								map.put("userimageuser",
										c.getString("userimageuser"));
								map.put("UIDuser", c.getString("UIDuser"));
								map.put("TotalsLikesSyn",
										c.getString("TotalsLikesSyn"));
								map.put("SYNNID", c.getString("SYNNID"));
								Log.e("REQUEST :",
										"TOT LIKES ****:"
												+ c.getString("TotalsLikesSyn"));
								// Set the JSON Objects into the array
								arraylist.add(map);
							}
						} catch (Exception e) {
							Log.v(TAG, "***** Exception DJ 2*****:" + e);
						}

					}

				}

			} catch (Exception e) {
				Log.e("@@@@@@@@@@@", "Exception@@@@@@@@@@@:" + e);
			}
			return null;
		}

		@Override
		protected void onPostExecute(String args) {
			new loadSingleView().execute();
		}
	}

	/**********************************************************************/

	// ***********Memory Handling****************
	@Override
	protected void onStop() {
		super.onStop();
	}

	// Fires after the OnStop() state
	@Override
	protected void onDestroy() {
		super.onDestroy();
		try {
			trimCache(this);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public static void trimCache(Context context) {
		try {
			File dir = context.getCacheDir();
			if (dir != null && dir.isDirectory()) {
				deleteDir(dir);
			}
		} catch (Exception e) {
			// TODO: handle exception
		}
	}

	public static boolean deleteDir(File dir) {
		if (dir != null && dir.isDirectory()) {
			String[] children = dir.list();
			for (int i = 0; i < children.length; i++) {
				boolean success = deleteDir(new File(dir, children[i]));
				if (!success) {
					return false;
				}
			}
		}

		// The directory is now empty so delete it
		return dir.delete();
	}

	public class loadDefaultImage extends AsyncTask<String, String, String> {
		private final String TAG = null;

		@Override
		protected void onPreExecute() {
			super.onPreExecute();
			// Create a progressdialog
			mProgressDialog = new ProgressDialog(
					Maori_Curate_Idiom_Details.this);
			// Set progressdialog title
			// mProgressDialog.setTitle("Update Likes");
			// Set progressdialog message
			mProgressDialog.setMessage("Processing...");
			mProgressDialog.setIndeterminate(false);
			mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
			mProgressDialog.setCancelable(false);
			// Show progressdialog
			mProgressDialog.show();

		}

		@Override
		protected String doInBackground(String... args) {
			// TODO Auto-generated method stub
			ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
			try {
				HttpPost httppost = null;
				HttpConnectionParams.setConnectionTimeout(httpParameters,
						timeoutConnection);
				HttpClient httpclient = new DefaultHttpClient(httpParameters);
				httppost = new HttpPost(
						"http://langapp.mirzabros.com/maoriapi/saveDefaultImage.php");
				JSONObject json = new JSONObject();

				String[] LikeRefIdArray = LikeRefId.split("/");
				reloadREFNO = LikeRefIdArray[0]; // NID
				String synUID = LikeRefIdArray[1]; // NID
				String synMID = LikeRefIdArray[2]; // NID
				// Selected Type ID / content_type_id
				json.put("record1", reloadREFNO);
				// Selected UID / added_by
				json.put("record2", synUID);
				// Like Media Category
				json.put("record3", synMID);

				JSONArray postjson = new JSONArray();
				postjson.put(json);

				httppost.setHeader("json", json.toString());
				httppost.getParams().setParameter("jsonpost", postjson);
				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
				HttpResponse response = httpclient.execute(httppost);
				HttpEntity entity = response.getEntity();
				is = entity.getContent();
				if (is != null) {

					BufferedReader reader = new BufferedReader(
							new InputStreamReader(is, "iso-8859-1"), 8);
					sb = new StringBuilder();
					sb.append(reader.readLine() + "\n");
					String line = "0";

					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result = sb.toString();
					if (result != null) {

					}
				}

			} catch (Exception e) {
				Log.e("REQUEST :", "Exception LIKES*** :" + e);
			}
			return null;
		}

		@Override
		protected void onPostExecute(String args) {
			mProgressDialog.dismiss();
			reloadTAG = 99;
			new loadSingleView().execute();
		}
	}

	
/*********************CURATE**********************/
	
	private class UploadApprovalInformation extends AsyncTask<Void, Void, Void> {
		private final String TAG = null;

		@Override
		protected void onPreExecute() {
			super.onPreExecute();
		}

		@Override
		protected Void doInBackground(Void... params) {
			// TODO Auto-generated method stub
			ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
			try {
				HttpPost httppost = null;
				HttpConnectionParams.setConnectionTimeout(httpParameters,
						timeoutConnection);
				HttpClient httpclient = new DefaultHttpClient(httpParameters);
				JSONObject json = new JSONObject();
				httppost = new HttpPost(
						"http://langapp.mirzabros.com/maoriapi/curate/SaveCurateApprovalInfo.php");

				json.put("record1", UserID); // $approve_user
				json.put("record2", AprroveState); // $approve_state
				json.put("record3", nid); // $approve_node
				json.put("record4", "0"); // $approve_media
				json.put("record5", "0"); // $approve_media_id
	
				JSONArray postjson = new JSONArray();
				postjson.put(json);
				Log.v("TAG","POST SET DEF : " + postjson);
				httppost.setHeader("json", json.toString());
				httppost.getParams().setParameter("jsonpost", postjson);
				httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
				HttpResponse response = httpclient.execute(httppost);
				HttpEntity entity = response.getEntity();
				is = entity.getContent();
				if (is != null) {

					BufferedReader reader = new BufferedReader(
							new InputStreamReader(is, "iso-8859-1"), 8);
					sb = new StringBuilder();
					sb.append(reader.readLine() + "\n");
					String line = "0";

					while ((line = reader.readLine()) != null) {
						sb.append(line + "\n");
					}
					is.close();
					result = sb.toString();
					Log.v("TAG", "Print RES ***:" + result);
					if (result != null) {

					}
				}
			} catch (Exception e) {
				e.printStackTrace();
			}
			return null;
		}

		@Override
		protected void onPostExecute(Void args) {
			
		}
	}
	/**************************************************************************/
	public static String getDescription_a() {
		return Description_a;
	}

	public static void setDescription_a(String description_a) {
		Description_a = description_a;
	}

	public static String getDescription_b() {
		return Description_b;
	}

	public static void setDescription_b(String description_b) {
		Description_b = description_b;
	}

	public static String getSYNcurrent_location() {
		return SYNcurrent_location;
	}

	public static void setSYNcurrent_location(String sYNcurrent_location) {
		SYNcurrent_location = sYNcurrent_location;
	}

	public static String getSYNdialact() {
		return SYNdialact;
	}

	public static void setSYNdialact(String sYNdialact) {
		SYNdialact = sYNdialact;
	}

	public static String getFirst_namesuser() {
		return first_namesuser;
	}

	public static void setFirst_namesuser(String first_namesuser) {
		Maori_Curate_Idiom_Details.first_namesuser = first_namesuser;
	}

	public static String getLast_nameuser() {
		return last_nameuser;
	}

	public static void setLast_nameuser(String last_nameuser) {
		Maori_Curate_Idiom_Details.last_nameuser = last_nameuser;
	}

	public static String getSYNrole() {
		return SYNrole;
	}

	public static void setSYNrole(String sYNrole) {
		SYNrole = sYNrole;
	}

	public static String getUIDuser() {
		return UIDuser;
	}

	public static void setUIDuser(String uIDuser) {
		UIDuser = uIDuser;
	}

	public static String getSYNNID() {
		return SYNNID;
	}

	public static void setSYNNID(String sYNNID) {
		SYNNID = sYNNID;
	}

	public static String getSYNParentNID() {
		return SYNParentNID;
	}

	public static void setSYNParentNID(String sYNParentNID) {
		SYNParentNID = sYNParentNID;
	}

	public static String getSYNUserLikedSyn() {
		return SYNUserLikedSyn;
	}

	public static void setSYNUserLikedSyn(String sYNUserLikedSyn) {
		SYNUserLikedSyn = sYNUserLikedSyn;
	}

	public static String getSYNParentUID() {
		return SYNParentUID;
	}

	public static void setSYNParentUID(String sYNParentUID) {
		SYNParentUID = sYNParentUID;
	}

	public static String getTotalsLikesSyn() {
		return TotalsLikesSyn;
	}

	public static void setTotalsLikesSyn(String totalsLikesSyn) {
		TotalsLikesSyn = totalsLikesSyn;
	}

	public static String getUserimageuser() {
		return userimageuser;
	}

	public static void setUserimageuser(String userimageuser) {
		Maori_Curate_Idiom_Details.userimageuser = userimageuser;
	}

	public static String getIMAGEMID() {
		return IMAGEMID;
	}

	public static void setIMAGEMID(String iMAGEMID) {
		IMAGEMID = iMAGEMID;
	}

	public static String getIMAGElast_name() {
		return IMAGElast_name;
	}

	public static void setIMAGElast_name(String iMAGElast_name) {
		IMAGElast_name = iMAGElast_name;
	}

	public static String getIMAGEfirst_name() {
		return IMAGEfirst_name;
	}

	public static void setIMAGEfirst_name(String iMAGEfirst_name) {
		IMAGEfirst_name = iMAGEfirst_name;
	}

	public static String getAudioSyndialact() {
		return AudioSyndialact;
	}

	public static void setAudioSyndialact(String audioSyndialact) {
		AudioSyndialact = audioSyndialact;
	}

	public static String getIMAGETotalsLikes() {
		return IMAGETotalsLikes;
	}

	public static void setIMAGETotalsLikes(String iMAGETotalsLikes) {
		IMAGETotalsLikes = iMAGETotalsLikes;
	}

	public static String getUserLikedAudio() {
		return UserLikedAudio;
	}

	public static void setUserLikedAudio(String userLikedAudio) {
		UserLikedAudio = userLikedAudio;
	}

	public static String getAudioParentUID() {
		return AudioParentUID;
	}

	public static void setAudioParentUID(String audioParentUID) {
		AudioParentUID = audioParentUID;
	}

	public static String getAudioParentNID() {
		return AudioParentNID;
	}

	public static void setAudioParentNID(String audioParentNID) {
		AudioParentNID = audioParentNID;
	}

	public static String getIMAGEM_Source() {
		return IMAGEM_Source;
	}

	public static void setIMAGEM_Source(String iMAGEM_Source) {
		IMAGEM_Source = iMAGEM_Source;
	}

	public static String getIMAGENID() {
		return IMAGENID;
	}

	public static void setIMAGENID(String iMAGENID) {
		IMAGENID = iMAGENID;
	}

	public static String getImageSyndialact() {
		return ImageSyndialact;
	}

	public static void setImageSyndialact(String imageSyndialact) {
		ImageSyndialact = imageSyndialact;
	}

	public static String getImageParentUID() {
		return ImageParentUID;
	}

	public static void setImageParentUID(String imageParentUID) {
		ImageParentUID = imageParentUID;
	}

	public static String getImageParentNID() {
		return ImageParentNID;
	}

	public static void setImageParentNID(String imageParentNID) {
		ImageParentNID = imageParentNID;
	}

	public static String getUserLikedImage() {
		return UserLikedImage;
	}

	public static void setUserLikedImage(String userLikedImage) {
		UserLikedImage = userLikedImage;
	}

	public static String getVideoSyndialact() {
		return VideoSyndialact;
	}

	public static void setVideoSyndialact(String videoSyndialact) {
		VideoSyndialact = videoSyndialact;
	}

	public static String getUserLikedVideo() {
		return UserLikedVideo;
	}

	public static void setUserLikedVideo(String userLikedVideo) {
		UserLikedVideo = userLikedVideo;
	}

	public static String getVideoParentNID() {
		return VideoParentNID;
	}

	public static void setVideoParentNID(String videoParentNID) {
		VideoParentNID = videoParentNID;
	}

	public static String getVideoParentUID() {
		return VideoParentUID;
	}

	public static void setVideoParentUID(String videoParentUID) {
		VideoParentUID = videoParentUID;
	}

	public static String getIMAGENM_ID() {
		return IMAGENM_ID;
	}

	public static void setIMAGENM_ID(String iMAGENM_ID) {
		IMAGENM_ID = iMAGENM_ID;
	}

	public static String getTotalsSetDefault() {
		return TotalsSetDefault;
	}

	public static void setTotalsSetDefault(String totalsSetDefault) {
		TotalsSetDefault = totalsSetDefault;
	}

	public static String getMediaUID() {
		return MediaUID;
	}

	public static void setMediaUID(String mediaUID) {
		MediaUID = mediaUID;
	}

	public static String getNodeMediaType() {
		return NodeMediaType;
	}

	public static void setNodeMediaType(String nodeMediaType) {
		NodeMediaType = nodeMediaType;
	}

	public static String getTotalsSetDefaultAudio() {
		return TotalsSetDefaultAudio;
	}

	public static void setTotalsSetDefaultAudio(String totalsSetDefaultAudio) {
		TotalsSetDefaultAudio = totalsSetDefaultAudio;
	}

	public static String getTotalsSetDefaultImage() {
		return TotalsSetDefaultImage;
	}

	public static void setTotalsSetDefaultImage(String totalsSetDefaultImage) {
		TotalsSetDefaultImage = totalsSetDefaultImage;
	}

	public static String getTotalsSetDefaultVideo() {
		return TotalsSetDefaultVideo;
	}

	public static void setTotalsSetDefaultVideo(String totalsSetDefaultVideo) {
		TotalsSetDefaultVideo = totalsSetDefaultVideo;
	}

	public static String getNodeMediaCode() {
		return NodeMediaCode;
	}

	public static void setNodeMediaCode(String nodeMediaCode) {
		NodeMediaCode = nodeMediaCode;
	}

	public static String getUserCurateStateSynonim() {
		return UserCurateStateSynonim;
	}

	public static void setUserCurateStateSynonim(String userCurateStateSynonim) {
		UserCurateStateSynonim = userCurateStateSynonim;
	}

	public static String getUserCurateStateAudio() {
		return UserCurateStateAudio;
	}

	public static void setUserCurateStateAudio(String userCurateStateAudio) {
		UserCurateStateAudio = userCurateStateAudio;
	}

	public static String getUserCurateStateImage() {
		return UserCurateStateImage;
	}

	public static void setUserCurateStateImage(String userCurateStateImage) {
		UserCurateStateImage = userCurateStateImage;
	}

	public static String getUserCurateStateVideo() {
		return UserCurateStateVideo;
	}

	public static void setUserCurateStateVideo(String userCurateStateVideo) {
		UserCurateStateVideo = userCurateStateVideo;
	}

	public static String getSYNtribe() {
		return SYNtribe;
	}

	public static void setSYNtribe(String sYNtribe) {
		SYNtribe = sYNtribe;
	}

	public static String getNodeApprovalCountValSynonim() {
		return NodeApprovalCountValSynonim;
	}

	public static void setNodeApprovalCountValSynonim(
			String nodeApprovalCountValSynonim) {
		NodeApprovalCountValSynonim = nodeApprovalCountValSynonim;
	}

	public static String getNodeRejectedCountValSynonim() {
		return NodeRejectedCountValSynonim;
	}

	public static void setNodeRejectedCountValSynonim(
			String nodeRejectedCountValSynonim) {
		NodeRejectedCountValSynonim = nodeRejectedCountValSynonim;
	}
}
